Document context_model as coordinates-only with label context
Browse files
README.md
CHANGED
|
@@ -11,8 +11,8 @@ tags:
|
|
| 11 |
# STIP tutorial checkpoints
|
| 12 |
|
| 13 |
Small checkpoints used by the [`stip`](https://github.com/instadeepai/stip) tutorial
|
| 14 |
-
notebooks
|
| 15 |
-
They are toy models (a two-layer MLP, ~50k parameters,
|
| 16 |
trained for 1500 steps on a 4-component 2D Gaussian mixture) and have no
|
| 17 |
use outside the notebooks.
|
| 18 |
|
|
@@ -23,13 +23,13 @@ Checkpoints are [Orbax](https://orbax.readthedocs.io) directories written by
|
|
| 23 |
## `conditioning_and_guidance/`
|
| 24 |
|
| 25 |
Used by `tutorials/notebooks/4.conditioning_and_guidance.ipynb`. Both models are
|
| 26 |
-
`VelocityGenerativeModel`s
|
| 27 |
-
|
| 28 |
|
| 29 |
-
| Path | Model | Role in the notebook |
|
| 30 |
-
|---|---|---|
|
| 31 |
-
| `conditioning_and_guidance/joint_model` | Unconditional cross-modal MLP | Intrinsic guidance (Section 4): conditioning a model
|
| 32 |
-
| `conditioning_and_guidance/context_model` | The same MLP plus a label context path, trained with 20% context dropout | Context conditioning and classifier-free guidance (Sections 5-7) |
|
| 33 |
|
| 34 |
### Loading
|
| 35 |
|
|
@@ -54,3 +54,13 @@ gen_model = nnx.merge(graphdef, checkpointer.restore_ema(params))
|
|
| 54 |
|
| 55 |
`restore_ema` reads only `ema_params` and `extra`, and applies the same bias
|
| 56 |
correction the training loop uses for evaluation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
# STIP tutorial checkpoints
|
| 12 |
|
| 13 |
Small checkpoints used by the [`stip`](https://github.com/instadeepai/stip) tutorial
|
| 14 |
+
notebooks, so that a tutorial can demonstrate sampling without spending ten
|
| 15 |
+
minutes training first. They are toy models (a two-layer MLP, ~50k parameters,
|
| 16 |
trained for 1500 steps on a 4-component 2D Gaussian mixture) and have no
|
| 17 |
use outside the notebooks.
|
| 18 |
|
|
|
|
| 23 |
## `conditioning_and_guidance/`
|
| 24 |
|
| 25 |
Used by `tutorials/notebooks/4.conditioning_and_guidance.ipynb`. Both models are
|
| 26 |
+
`VelocityGenerativeModel`s with a `FlowMatchingOneSidedInterpolant`, but over
|
| 27 |
+
different modalities:
|
| 28 |
|
| 29 |
+
| Path | Model | Modalities | Role in the notebook |
|
| 30 |
+
|---|---|---|---|
|
| 31 |
+
| `conditioning_and_guidance/joint_model` | Unconditional cross-modal MLP | `coordinates` (continuous, 2D) and `index` (discrete, 4 categories) | Intrinsic guidance (Section 4): conditioning a model that was never trained to be conditional |
|
| 32 |
+
| `conditioning_and_guidance/context_model` | The same MLP plus a label context path, trained with 20% context dropout | `coordinates` only; the corner label is passed as `context_data` instead of as a modality | Context conditioning and classifier-free guidance (Sections 5-7) |
|
| 33 |
|
| 34 |
### Loading
|
| 35 |
|
|
|
|
| 54 |
|
| 55 |
`restore_ema` reads only `ema_params` and `extra`, and applies the same bias
|
| 56 |
correction the training loop uses for evaluation.
|
| 57 |
+
|
| 58 |
+
## Reproducing
|
| 59 |
+
|
| 60 |
+
```bash
|
| 61 |
+
uv run python tutorials/scripts/train_conditioning_checkpoints.py
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
The script mirrors the notebook's model definitions and PRNG chain, so it
|
| 65 |
+
reproduces these exact weights. A checkpoint pins the parameter structure: if a
|
| 66 |
+
notebook's network changes, re-run the script and re-upload.
|