Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -18,15 +18,15 @@ pipeline_tag: other
|
|
| 18 |
|
| 19 |
Pre-trained checkpoints for **QHFlow2** on the **QH9** dataset (DFT Hamiltonian prediction).
|
| 20 |
|
| 21 |
-
**Paper:** [High-order Equivariant Flow Matching for Density Functional Theory Hamiltonian Prediction](https://arxiv.org/abs/2602.16897)
|
| 22 |
-
**Authors:** Seongsu Kim, Nayoung Kim, Dongwoo Kim, Sungsoo Ahn (KAIST)
|
| 23 |
-
**Venue:** NeurIPS 2025
|
| 24 |
-
**Code:** [github.com/seongsukim-ml/QHFlow2](https://github.com/seongsukim-ml/QHFlow2)
|
| 25 |
|
| 26 |
## Model Variants
|
| 27 |
|
| 28 |
| Size | hidden_size | num_gnn_layers | Params | Checkpoint Size |
|
| 29 |
-
|------|-------------|---------------|--------|----------------|
|
| 30 |
| small | 64 | 3 | ~35M | 139 MB |
|
| 31 |
| middle | 128 | 3 | ~125M | 494 MB |
|
| 32 |
| large | 256 | 4 | ~530M | 2.0 GB |
|
|
@@ -34,26 +34,121 @@ Pre-trained checkpoints for **QHFlow2** on the **QH9** dataset (DFT Hamiltonian
|
|
| 34 |
|
| 35 |
## Dataset Splits
|
| 36 |
|
| 37 |
-
|
| 38 |
-
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
| 41 |
|
| 42 |
## File Structure
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
## Citation
|
| 55 |
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
## License
|
| 59 |
|
|
|
|
| 18 |
|
| 19 |
Pre-trained checkpoints for **QHFlow2** on the **QH9** dataset (DFT Hamiltonian prediction).
|
| 20 |
|
| 21 |
+
> **Paper:** [High-order Equivariant Flow Matching for Density Functional Theory Hamiltonian Prediction](https://arxiv.org/abs/2602.16897)
|
| 22 |
+
> **Authors:** Seongsu Kim, Nayoung Kim, Dongwoo Kim, Sungsoo Ahn (KAIST)
|
| 23 |
+
> **Venue:** NeurIPS 2025
|
| 24 |
+
> **Code:** [github.com/seongsukim-ml/QHFlow2](https://github.com/seongsukim-ml/QHFlow2)
|
| 25 |
|
| 26 |
## Model Variants
|
| 27 |
|
| 28 |
| Size | hidden_size | num_gnn_layers | Params | Checkpoint Size |
|
| 29 |
+
|------|-------------|----------------|--------|-----------------|
|
| 30 |
| small | 64 | 3 | ~35M | 139 MB |
|
| 31 |
| middle | 128 | 3 | ~125M | 494 MB |
|
| 32 |
| large | 256 | 4 | ~530M | 2.0 GB |
|
|
|
|
| 34 |
|
| 35 |
## Dataset Splits
|
| 36 |
|
| 37 |
+
| Split | Description | Epochs |
|
| 38 |
+
|-------|-------------|--------|
|
| 39 |
+
| QH9Stable-random | Random train/test split | 78 |
|
| 40 |
+
| QH9Stable-size_ood | Size out-of-distribution | 78 |
|
| 41 |
+
| QH9Dynamic-300k-geometry | Geometry OOD (300k conformers) | 33 |
|
| 42 |
+
| QH9Dynamic-300k-mol | Molecular OOD (300k conformers) | 33 |
|
| 43 |
|
| 44 |
## File Structure
|
| 45 |
|
| 46 |
+
```
|
| 47 |
+
{split}/
|
| 48 |
+
QHFlow_so2_v5_1_{size}-{split}/
|
| 49 |
+
weights-epoch=XX-val_loss=0.0000000.ckpt
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## Quick Start
|
| 53 |
+
|
| 54 |
+
### 1. Install QHFlow2
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
git clone https://github.com/seongsukim-ml/QHFlow2.git
|
| 58 |
+
cd QHFlow2
|
| 59 |
+
pip install -e ".[fairchem]"
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
### 2. Download Checkpoints
|
| 63 |
+
|
| 64 |
+
```bash
|
| 65 |
+
pip install huggingface_hub
|
| 66 |
+
|
| 67 |
+
# Download a single checkpoint
|
| 68 |
+
huggingface-cli download ksusu/QHFlow2-QH9 \
|
| 69 |
+
"QH9Stable-random/QHFlow_so2_v5_1_small-QH9Stable-random/weights-epoch=78-val_loss=0.0000000.ckpt" \
|
| 70 |
+
--local-dir ckpt/QH9
|
| 71 |
+
|
| 72 |
+
# Download all checkpoints for a specific split
|
| 73 |
+
huggingface-cli download ksusu/QHFlow2-QH9 \
|
| 74 |
+
--include "QH9Stable-random/*" \
|
| 75 |
+
--local-dir ckpt/QH9
|
| 76 |
+
|
| 77 |
+
# Download everything (~48 GB)
|
| 78 |
+
huggingface-cli download ksusu/QHFlow2-QH9 --local-dir ckpt/QH9
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
Or in Python:
|
| 82 |
+
|
| 83 |
+
```python
|
| 84 |
+
from huggingface_hub import hf_hub_download
|
| 85 |
+
|
| 86 |
+
path = hf_hub_download(
|
| 87 |
+
repo_id="ksusu/QHFlow2-QH9",
|
| 88 |
+
filename="QH9Stable-random/QHFlow_so2_v5_1_small-QH9Stable-random/weights-epoch=78-val_loss=0.0000000.ckpt",
|
| 89 |
+
)
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
### 3. Run Prediction
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
cd QHFlow2
|
| 96 |
+
|
| 97 |
+
# Predict on QH9Stable test set
|
| 98 |
+
python -m qhflow2.experiment.train_qh9 \
|
| 99 |
+
mode=predict \
|
| 100 |
+
dataset=QH9Stable \
|
| 101 |
+
dataset.split=random \
|
| 102 |
+
model=QHFlow_so2_v5_1_small \
|
| 103 |
+
ckpt=ckpt/QH9/QH9Stable-random/QHFlow_so2_v5_1_small-QH9Stable-random/weights-epoch=78-val_loss=0.0000000.ckpt
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
### 4. Python API
|
| 107 |
+
|
| 108 |
+
```python
|
| 109 |
+
import torch
|
| 110 |
+
from qhflow2.models import get_model, get_default_model_args
|
| 111 |
+
|
| 112 |
+
# Build model
|
| 113 |
+
args = get_default_model_args("qh9")
|
| 114 |
+
args["version"] = "QHFlow_so2_v5_1"
|
| 115 |
+
args["hidden_size"] = 64 # small
|
| 116 |
+
args["num_gnn_layers"] = 3
|
| 117 |
+
model = get_model(args)
|
| 118 |
+
|
| 119 |
+
# Load checkpoint
|
| 120 |
+
ckpt = torch.load("weights-epoch=78-val_loss=0.0000000.ckpt", map_location="cpu")
|
| 121 |
+
state_dict = {k.replace("model.", ""): v for k, v in ckpt["state_dict"].items()}
|
| 122 |
+
model.load_state_dict(state_dict, strict=False)
|
| 123 |
+
model.eval()
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
### 5. Load via Lightning (full pipeline)
|
| 127 |
+
|
| 128 |
+
```python
|
| 129 |
+
from qhflow2.pl_module import _get_model_by_pl_type
|
| 130 |
+
from omegaconf import OmegaConf
|
| 131 |
+
|
| 132 |
+
conf = OmegaConf.load("configs/qh9/config_flow_v2_simple.yaml")
|
| 133 |
+
LitModel = _get_model_by_pl_type("flow")
|
| 134 |
+
lit_model = LitModel.load_from_checkpoint(
|
| 135 |
+
"weights-epoch=78-val_loss=0.0000000.ckpt",
|
| 136 |
+
conf=conf,
|
| 137 |
+
strict=False,
|
| 138 |
+
)
|
| 139 |
+
lit_model.eval()
|
| 140 |
+
```
|
| 141 |
|
| 142 |
## Citation
|
| 143 |
|
| 144 |
+
```bibtex
|
| 145 |
+
@inproceedings{kim2025high,
|
| 146 |
+
title={High-order Equivariant Flow Matching for Density Functional Theory Hamiltonian Prediction},
|
| 147 |
+
author={Kim, Seongsu and Kim, Nayoung and Kim, Dongwoo and Ahn, Sungsoo},
|
| 148 |
+
booktitle={Advances in Neural Information Processing Systems},
|
| 149 |
+
year={2025}
|
| 150 |
+
}
|
| 151 |
+
```
|
| 152 |
|
| 153 |
## License
|
| 154 |
|