rezapop commited on
Commit
1a7ec8c
·
verified ·
1 Parent(s): b599192

IDFF paper (TMLR 2026) and trained checkpoints

Browse files
.gitattributes CHANGED
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ assets/idff_2d.gif filter=lfs diff=lfs merge=lfs -text
37
+ assets/idff_lorenz.gif filter=lfs diff=lfs merge=lfs -text
38
+ paper/IDFF_TMLR_2026.pdf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ library_name: pytorch
4
+ tags:
5
+ - generative-modeling
6
+ - flow-matching
7
+ - diffusion
8
+ - score-matching
9
+ - langevin-dynamics
10
+ - time-series
11
+ - molecular-dynamics
12
+ ---
13
+
14
+ # Implicit Dynamical Flow Fusion (IDFF) for Generative Modeling
15
+
16
+ **Mohammad R. Rezaei, Milos R. Popovic, Milad Lankarany, Rahul G. Krishnan**
17
+ *Transactions on Machine Learning Research (TMLR), 2026*
18
+
19
+ [Paper (PDF)](paper/IDFF_TMLR_2026.pdf) ·
20
+ [OpenReview](https://openreview.net/forum?id=RWnohJJKbq) ·
21
+ [arXiv](https://arxiv.org/abs/2409.14599) ·
22
+ [Code (GitHub)](https://github.com/MrRezaeiUofT/Implicit_Dynamical_Flow_Fusion_for_Genereative_Modeling) ·
23
+ [Code (Hugging Face mirror)](https://huggingface.co/rezapop/IDFF-code)
24
+
25
+ This repository holds the paper and the trained checkpoints of the 2-D and time-series examples. The
26
+ code is in [rezapop/IDFF-code](https://huggingface.co/rezapop/IDFF-code) and on GitHub (release `v1.0.0`).
27
+
28
+ ## Abstract
29
+
30
+ Conditional Flow Matching (CFM) generates high-quality samples by learning a deterministic transport from
31
+ noise to data, but typically requires more than a hundred network function evaluations (NFEs) per sample.
32
+ IDFF augments the CFM vector field with $K$th-order score-derivative terms and attains comparable sample
33
+ quality with significantly fewer NFEs. At first order ($K=1$) the method reduces to a Langevin-augmented
34
+ flow whose marginal $p_t$ is preserved exactly in continuous time, so the NFE reduction is a statement about
35
+ discretization robustness. For $K=2$ the paper gives an error analysis showing that the deviation of the
36
+ optional curvature correction is bounded by the weighted score-matching loss already minimized by the
37
+ objective. Every higher-order marginal derivative is obtained from the learned first-order score by
38
+ automatic differentiation, so no additional networks are trained. On CIFAR-10 the $K=1$ configuration
39
+ reaches an FID of 2.78 at 10 NFEs; IDFF also performs strongly on molecular-dynamics simulation and
40
+ sea-surface-temperature forecasting.
41
+
42
+ ## Examples
43
+
44
+ <p align="center">
45
+ <img src="assets/idff_2d.gif" alt="CFM vs IDFF K=1 and K=2 sampling at NFE=5 on 8 Gaussians" width="90%"/>
46
+ </p>
47
+ <p align="center"><em>8 Gaussians with 5 network evaluations, same noise and same trained network:
48
+ deterministic CFM (blue), IDFF K=1 (red) and IDFF K=2 (purple).</em></p>
49
+
50
+ <p align="center">
51
+ <img src="assets/idff_lorenz.gif" alt="CFM, IDFF K=1 and IDFF K=2 rollouts on the Lorenz attractor" width="95%"/>
52
+ </p>
53
+ <p align="center"><em>Autoregressive rollouts over a 2000-step held-out Lorenz trajectory at 5 NFE per frame
54
+ against the simulated trajectory (grey).</em></p>
55
+
56
+ ## Files
57
+
58
+ | path | contents |
59
+ |---|---|
60
+ | `paper/IDFF_TMLR_2026.pdf` | camera-ready paper |
61
+ | `checkpoints/2d/{8gaussians,checkerboard,moons}/idff_model.pt` | 2-D joint-head MLPs (`hidden=256, depth=3, sigma0=0.2`) |
62
+ | `checkpoints/lorenz/idff_model.pt` | Lorenz model (`hidden=128, depth=2, sigma0=0.05`, 2000 positions) |
63
+ | `checkpoints/polyALA/idff_md.pt` | polyALA molecular-dynamics surrogate (46 dihedral angles, 200 positions) |
64
+ | `checkpoints/*/config.json` | training arguments and the sampler settings selected on validation data |
65
+ | `assets/*.gif` | the animations above |
66
+
67
+ The checkpoints are PyTorch `state_dict`s for `idff.JointHeadMLP`; load them with `weights_only=True`.
68
+
69
+ ## Usage
70
+
71
+ ```bash
72
+ git clone https://huggingface.co/rezapop/IDFF-code && cd IDFF-code
73
+ pip install -r requirements.txt
74
+ ```
75
+
76
+ ```python
77
+ import json, torch
78
+ from huggingface_hub import hf_hub_download
79
+ from idff import JointHeadMLP, sample
80
+
81
+ repo = "rezapop/IDFF"
82
+ cfg = json.load(open(hf_hub_download(repo, "checkpoints/2d/8gaussians/config.json")))
83
+ model = JointHeadMLP(2, hidden=256, depth=3, sigma0=cfg["sigma0"])
84
+ model.load_state_dict(torch.load(hf_hub_download(repo, "checkpoints/2d/8gaussians/idff_model.pt"),
85
+ map_location="cpu", weights_only=True))
86
+ model.eval()
87
+
88
+ nfe = 5
89
+ s = cfg["selected"][str(nfe)] # gamma_bar and alpha_2 chosen on validation data
90
+ x_k1 = sample(model, torch.randn(2000, 2), nfe, K=1, gamma_bar=s["gamma_bar"])
91
+ x_k2 = sample(model, torch.randn(2000, 2), nfe, K=2, gamma_bar=s["gamma_bar"], alphas={2: s["alpha_2"]})
92
+ x_cfm = sample(model, torch.randn(2000, 2), nfe, K=0) # deterministic CFM baseline
93
+ ```
94
+
95
+ ## Citation
96
+
97
+ ```bibtex
98
+ @article{rezaei2026idff,
99
+ title = {Implicit Dynamical Flow Fusion ({IDFF}) for Generative Modeling},
100
+ author = {Rezaei, Mohammad R. and Popovic, Milos R. and Lankarany, Milad and Krishnan, Rahul G.},
101
+ journal = {Transactions on Machine Learning Research},
102
+ year = {2026},
103
+ url = {https://openreview.net/forum?id=RWnohJJKbq}
104
+ }
105
+ ```
assets/idff_2d.gif ADDED

Git LFS Details

  • SHA256: a5a757aef3a62514aba918039c49212c62a5a0ffa774cb20d3f62c736834b2be
  • Pointer size: 131 Bytes
  • Size of remote file: 712 kB
assets/idff_lorenz.gif ADDED

Git LFS Details

  • SHA256: ff1e39e4d7f0122417a2281286b9f22616bcdc5d043da19022b14c43e8b08986
  • Pointer size: 132 Bytes
  • Size of remote file: 3.69 MB
checkpoints/2d/8gaussians/config.json ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": "8gaussians",
3
+ "iters": 60000,
4
+ "batch": 512,
5
+ "lr": 0.001,
6
+ "sigma0": 0.2,
7
+ "coupling": "independent",
8
+ "nfes": [
9
+ 2,
10
+ 3,
11
+ 5,
12
+ 10,
13
+ 20
14
+ ],
15
+ "gamma_c_grid": [
16
+ 0.5,
17
+ 1.0,
18
+ 2.0,
19
+ 4.0,
20
+ 8.0,
21
+ 16.0,
22
+ 32.0
23
+ ],
24
+ "alpha_grid": [
25
+ -4.0,
26
+ -2.0,
27
+ -1.0,
28
+ -0.5,
29
+ -0.1,
30
+ 0.1,
31
+ 0.5,
32
+ 1.0,
33
+ 2.0,
34
+ 4.0
35
+ ],
36
+ "n_eval": 3000,
37
+ "seeds": 5,
38
+ "retrain": false,
39
+ "out": "2D_examples/outputs",
40
+ "selected": {
41
+ "2": {
42
+ "gamma_bar": 0.25,
43
+ "alpha_2": 0.0,
44
+ "alpha_3": 0.0
45
+ },
46
+ "3": {
47
+ "gamma_bar": 2.6666666666666665,
48
+ "alpha_2": -0.5,
49
+ "alpha_3": -1.0
50
+ },
51
+ "5": {
52
+ "gamma_bar": 0.8,
53
+ "alpha_2": -1.0,
54
+ "alpha_3": -4.0
55
+ },
56
+ "10": {
57
+ "gamma_bar": 1.6,
58
+ "alpha_2": -0.5,
59
+ "alpha_3": -4.0
60
+ },
61
+ "20": {
62
+ "gamma_bar": 0.8,
63
+ "alpha_2": -1.0,
64
+ "alpha_3": -1.0
65
+ }
66
+ }
67
+ }
checkpoints/2d/8gaussians/idff_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:969f41be49ca0a053690582566842b975496818eeeee8fab32e985116201597a
3
+ size 547253
checkpoints/2d/checkerboard/config.json ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": "checkerboard",
3
+ "iters": 60000,
4
+ "batch": 512,
5
+ "lr": 0.001,
6
+ "sigma0": 0.2,
7
+ "coupling": "independent",
8
+ "nfes": [
9
+ 2,
10
+ 3,
11
+ 5,
12
+ 10,
13
+ 20
14
+ ],
15
+ "gamma_c_grid": [
16
+ 0.5,
17
+ 1.0,
18
+ 2.0,
19
+ 4.0,
20
+ 8.0,
21
+ 16.0,
22
+ 32.0
23
+ ],
24
+ "alpha_grid": [
25
+ -4.0,
26
+ -2.0,
27
+ -1.0,
28
+ -0.5,
29
+ -0.1,
30
+ 0.1,
31
+ 0.5,
32
+ 1.0,
33
+ 2.0,
34
+ 4.0
35
+ ],
36
+ "n_eval": 3000,
37
+ "seeds": 5,
38
+ "retrain": false,
39
+ "out": "2D_examples/outputs",
40
+ "selected": {
41
+ "2": {
42
+ "gamma_bar": 0.25,
43
+ "alpha_2": 0.0,
44
+ "alpha_3": 0.0
45
+ },
46
+ "3": {
47
+ "gamma_bar": 5.333333333333333,
48
+ "alpha_2": -2.0,
49
+ "alpha_3": -0.1
50
+ },
51
+ "5": {
52
+ "gamma_bar": 3.2,
53
+ "alpha_2": -2.0,
54
+ "alpha_3": -1.0
55
+ },
56
+ "10": {
57
+ "gamma_bar": 0.8,
58
+ "alpha_2": -2.0,
59
+ "alpha_3": -4.0
60
+ },
61
+ "20": {
62
+ "gamma_bar": 1.6,
63
+ "alpha_2": -2.0,
64
+ "alpha_3": -4.0
65
+ }
66
+ }
67
+ }
checkpoints/2d/checkerboard/idff_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66d1c2763133bb7f9eeff4fe451acd129198eed1e79b2e8e2b27411fd48ad9fe
3
+ size 547619
checkpoints/2d/moons/config.json ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": "moons",
3
+ "iters": 60000,
4
+ "batch": 512,
5
+ "lr": 0.001,
6
+ "sigma0": 0.2,
7
+ "coupling": "independent",
8
+ "nfes": [
9
+ 2,
10
+ 3,
11
+ 5,
12
+ 10,
13
+ 20
14
+ ],
15
+ "gamma_c_grid": [
16
+ 0.5,
17
+ 1.0,
18
+ 2.0,
19
+ 4.0,
20
+ 8.0,
21
+ 16.0,
22
+ 32.0
23
+ ],
24
+ "alpha_grid": [
25
+ -4.0,
26
+ -2.0,
27
+ -1.0,
28
+ -0.5,
29
+ -0.1,
30
+ 0.1,
31
+ 0.5,
32
+ 1.0,
33
+ 2.0,
34
+ 4.0
35
+ ],
36
+ "n_eval": 3000,
37
+ "seeds": 5,
38
+ "retrain": false,
39
+ "out": "2D_examples/outputs",
40
+ "selected": {
41
+ "2": {
42
+ "gamma_bar": 0.25,
43
+ "alpha_2": 0.0,
44
+ "alpha_3": 0.0
45
+ },
46
+ "3": {
47
+ "gamma_bar": 2.6666666666666665,
48
+ "alpha_2": -4.0,
49
+ "alpha_3": 1.0
50
+ },
51
+ "5": {
52
+ "gamma_bar": 3.2,
53
+ "alpha_2": -2.0,
54
+ "alpha_3": -1.0
55
+ },
56
+ "10": {
57
+ "gamma_bar": 1.6,
58
+ "alpha_2": -2.0,
59
+ "alpha_3": -4.0
60
+ },
61
+ "20": {
62
+ "gamma_bar": 1.6,
63
+ "alpha_2": -2.0,
64
+ "alpha_3": -4.0
65
+ }
66
+ }
67
+ }
checkpoints/2d/moons/idff_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bbf85577af98bf26c05489a736f77ad524630289a5f24602c8c0827feb84d30e
3
+ size 547253
checkpoints/lorenz/config.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "system": "lorenz",
3
+ "length": 2000,
4
+ "n_train": 32,
5
+ "n_val": 4,
6
+ "n_test": 8,
7
+ "iters": 20000,
8
+ "batch": 512,
9
+ "lr": 0.001,
10
+ "sigma0": 0.05,
11
+ "nfes": [
12
+ 2,
13
+ 3,
14
+ 5,
15
+ 10
16
+ ],
17
+ "gamma_rel_grid": [
18
+ 0.1,
19
+ 0.3,
20
+ 1.0,
21
+ 3.0,
22
+ 10.0
23
+ ],
24
+ "alpha_grid": [
25
+ -1000.0,
26
+ -100.0,
27
+ -10.0,
28
+ -1.0,
29
+ 1.0,
30
+ 10.0,
31
+ 100.0,
32
+ 1000.0
33
+ ],
34
+ "seeds": 10,
35
+ "select_by": "rollout_mmd",
36
+ "select_seeds": 3,
37
+ "retrain": false,
38
+ "out": "timeseris_example/outputs",
39
+ "selected": {
40
+ "2": {
41
+ "gamma_bar": 0.00025000000000000006,
42
+ "alpha_2": 0.0
43
+ },
44
+ "3": {
45
+ "gamma_bar": 0.0007500000000000001,
46
+ "alpha_2": 0.0
47
+ },
48
+ "5": {
49
+ "gamma_bar": 0.00025000000000000006,
50
+ "alpha_2": -10.0
51
+ },
52
+ "10": {
53
+ "gamma_bar": 0.0007500000000000001,
54
+ "alpha_2": 0.0
55
+ }
56
+ }
57
+ }
checkpoints/lorenz/idff_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a34994890468bfc838d84ffb1d37f7e37b1001914e994f3805526e554a4a3ab
3
+ size 624757
checkpoints/polyALA/config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "data": "timeseris_example/data/polyALA_angles.npz",
3
+ "iters": 20000,
4
+ "batch": 256,
5
+ "lr": 0.001,
6
+ "sigma0": 0.1,
7
+ "nfes": [
8
+ 3,
9
+ 5,
10
+ 10
11
+ ],
12
+ "gamma_rel": 1.0,
13
+ "alpha2": 0.05,
14
+ "num_traj": 5,
15
+ "seeds": 3,
16
+ "sweep": true,
17
+ "retrain": false,
18
+ "out": "timeseris_example/outputs/polyALA"
19
+ }
checkpoints/polyALA/idff_md.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f3fbeb6f773815fa31c9fa0895e9e4b24f1a01600f165582578e3b8bd20adf6
3
+ size 799167
paper/IDFF_TMLR_2026.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6bdf7b4d54f7e4669e41abd061c6c64d2ece27cfaa3ffdf33d3c22c79bef653
3
+ size 2768194