Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -21,6 +21,7 @@ Each round — a **loop** — proposes new culture protocols, runs them at the b
|
|
| 21 |
resulting cells. The measurements from each loop are published here as a separate file.
|
| 22 |
|
| 23 |
- **Code and full reproduction pipeline:** <https://github.com/theislab/LabCompass>
|
|
|
|
| 24 |
- **Wet-lab experiments and measurements:** Göttgens Lab
|
| 25 |
- **License:** CC-BY-4.0
|
| 26 |
|
|
@@ -112,6 +113,69 @@ path = hf_hub_download(
|
|
| 112 |
adata = ad.read_h5ad(path)
|
| 113 |
```
|
| 114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
## Citation
|
| 116 |
|
| 117 |
<!-- TODO: replace with the published reference before release. -->
|
|
|
|
| 21 |
resulting cells. The measurements from each loop are published here as a separate file.
|
| 22 |
|
| 23 |
- **Code and full reproduction pipeline:** <https://github.com/theislab/LabCompass>
|
| 24 |
+
- **Contents:** per-loop measurements in `loops/`, trained models in `checkpoints/`
|
| 25 |
- **Wet-lab experiments and measurements:** Göttgens Lab
|
| 26 |
- **License:** CC-BY-4.0
|
| 27 |
|
|
|
|
| 113 |
adata = ad.read_h5ad(path)
|
| 114 |
```
|
| 115 |
|
| 116 |
+
## Model checkpoints
|
| 117 |
+
|
| 118 |
+
`checkpoints/` holds the trained models behind the paper's designs, one folder per loop:
|
| 119 |
+
|
| 120 |
+
| Folder | Size | Forward model | Config group |
|
| 121 |
+
| --- | --- | --- | --- |
|
| 122 |
+
| `checkpoints/loop0/` | 1.7 GB | `likely-donkey-20` | `paths=loop0` |
|
| 123 |
+
| `checkpoints/loop1/` | 1.9 GB | `eager-feather-1` | `paths=loop1` |
|
| 124 |
+
| `checkpoints/loop2/` | 2.1 GB | `fresh-bee-21` | `paths=loop2_replicate` |
|
| 125 |
+
| `checkpoints/loop2p5/` | 2.3 GB | `celestial-fire-40` | `paths=loop2p5_replicate` |
|
| 126 |
+
| `checkpoints/loop3/` | 2.6 GB | `rich-sunset-44` | `paths=loop3_replicate` |
|
| 127 |
+
| `checkpoints/loop4/` | 2.6 GB | `fast-gorge-13` | `paths=loop4_replicate` |
|
| 128 |
+
|
| 129 |
+
**Loop *N*'s models are the ones that generated the designs executed in loop *N+1*.** So to reproduce
|
| 130 |
+
the candidates that were run at the bench in loop 1, use `checkpoints/loop0/`.
|
| 131 |
+
|
| 132 |
+
Each folder contains the four models the pipeline needs:
|
| 133 |
+
|
| 134 |
+
- **`*_FlowMatching.pkl`** — the forward model: predicts the cell-state distribution a protocol induces.
|
| 135 |
+
- **`*_TargetPredictionModel.pkl`** — the cell-type classifier, i.e. the phenotypic readout that the
|
| 136 |
+
inverse objective is defined against.
|
| 137 |
+
- **`*_FlowMatchingWithScore.pkl`** — the generative prior over protocols.
|
| 138 |
+
- **`*_FlowMap.pkl`** — a distilled few-step version of that prior.
|
| 139 |
+
|
| 140 |
+
File names are the Weights & Biases run names, unchanged from training. `checkpoints/manifest.json`
|
| 141 |
+
records, for every file, which `paths` config group refers to it, its original size, and a sha256.
|
| 142 |
+
|
| 143 |
+
### Three things to know before using them
|
| 144 |
+
|
| 145 |
+
**They are inference-only.** The training and validation data that the original checkpoints carried
|
| 146 |
+
inside them has been removed — that is why a 113 GB file is 1 GB here. Everything inference touches
|
| 147 |
+
is intact (network weights bitwise unchanged, normalisation parameters, cell-type labels, the
|
| 148 |
+
condition key), and every checkpoint was verified tensor-by-tensor against its original and exercised
|
| 149 |
+
end-to-end through the pipeline. But you **cannot retrain a prior from these**: the scripts that do
|
| 150 |
+
so read the forward model's embedded training set, which is gone. Retrain the forward model from the
|
| 151 |
+
`loops/` data instead.
|
| 152 |
+
|
| 153 |
+
**They are CPU-resident.** The tensors load on any machine, with or without a GPU; move the model to
|
| 154 |
+
your device as you would any PyTorch module. The original checkpoints held CUDA tensors and could
|
| 155 |
+
only be loaded on a GPU node.
|
| 156 |
+
|
| 157 |
+
**Loops 3 and 4 use the expanded design space.** They were trained after M-CSF and the lymphoid
|
| 158 |
+
cocktail were added, so they expect the wider protocol vector and will fail with a shape mismatch if
|
| 159 |
+
you load them with the earlier annotation. Use `annotation=bloodplus_loop3` for those two; the
|
| 160 |
+
earlier loops use the default.
|
| 161 |
+
|
| 162 |
+
### Loading
|
| 163 |
+
|
| 164 |
+
```python
|
| 165 |
+
from huggingface_hub import hf_hub_download
|
| 166 |
+
from labcompass.models import FlowMatching
|
| 167 |
+
|
| 168 |
+
path = hf_hub_download(
|
| 169 |
+
repo_id="theislab/LabCompass",
|
| 170 |
+
filename="checkpoints/loop3/rich-sunset-44_FlowMatching.pkl",
|
| 171 |
+
repo_type="dataset",
|
| 172 |
+
)
|
| 173 |
+
model = FlowMatching.load(path)
|
| 174 |
+
```
|
| 175 |
+
|
| 176 |
+
In the reproduction repository these are wired up through the `paths` config group, so pointing a run
|
| 177 |
+
at a downloaded loop is a matter of overriding the four checkpoint paths.
|
| 178 |
+
|
| 179 |
## Citation
|
| 180 |
|
| 181 |
<!-- TODO: replace with the published reference before release. -->
|