[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80134":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":13,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},80134,"flux_matching","peterpaohuang\u002Fflux_matching","peterpaohuang","Generative Modeling with Flux Matching","",null,"Python",63,1,54,0,6,8,9,18,57.8,"MIT License",false,"main",true,[],"2026-06-12 04:01:26","# Flux Matching\n\n![Flux Matching](assets\u002Fflux_matching.gif)\n\nOfficial implementation of [Generative Modeling with Flux Matching](https:\u002F\u002Farxiv.org\u002Fabs\u002F2605.07319) by Peter Pao-Huang, Xiaojie Qiu, and Stefano Ermon.\n\n**Flux Matching** is a generative modeling paradigm for learning data generating vector fields beyond the score function. `src\u002F` contains the core Flux Matching library. `examples\u002F` contains simple usage examples to start training and sampling with Flux Matching. `experiments\u002F` contains all scripts and settings to setup, run, and recreate experiment results from the paper.\n\nPlease contact \u003Cpeterph@stanford.edu> with any comments or issues.\n\n---\n\n## Installation\n\nThis project was developed with Python 3.10. Other versions are untested.\n\nThe core library requires only PyTorch:\n\n```bash\npip install torch\n```\n\nFor the examples and experiments, install additional dependencies as needed:\n\n```bash\npip install torchdiffeq torchvision ema-pytorch scipy numpy matplotlib imageio tqdm pyyaml POT scanpy pandas\n```\n---\n\n## Quickstart\n\n```python\nimport torch\nfrom src.loss import flux_matching_loss\n\n# Define a simple vector field network\nmodel = torch.nn.Sequential(\n    torch.nn.Linear(2, 128), torch.nn.SiLU(),\n    torch.nn.Linear(128, 2),\n)\n\nx = torch.randn(64, 2)\nsigma2 = torch.tensor(0.1)\n\noptimizer = torch.optim.Adam(model.parameters(), lr=1e-3)\n\nfor step in range(1000):\n    loss = flux_matching_loss(model, x, sigma2).mean()\n    optimizer.zero_grad()\n    loss.backward()\n    optimizer.step()\n```\n\nMore comprehensive examples including noise annealed Flux Matching are in [examples\u002F](examples\u002F).\n\n---\n\n## Reproducing Experiments\n\nEach experiment has its own self-contained directory with a dedicated README covering data preparation, training commands, and evaluation:\n\n| Experiment | Description |\n|---|---|\n| [exp1_controllable](experiments\u002Fexp1_controllable\u002F) | Controllable Generative Fields (Toy) |\n| [exp2_rna_velocity](experiments\u002Fexp2_rna_velocity\u002F) | Interpretable Generative Fields (RNA velocity) |\n| [exp3_unrestricted](experiments\u002Fexp3_unrestricted\u002F) | Unrestricted Generative Fields (Images: CIFAR-10, CelebA) |\n| [exp4_fast_mixing](experiments\u002Fexp4_fast_mixing\u002F) | Fast Mixing Fields for Accelerated Sampling (Images: CIFAR-10, CelebA) |\n| [exp5_embed_structure](experiments\u002Fexp5_embed_structure\u002F) | Embedding Structure in Generative Fields (Physics Simulation) |\n\nSee each experiment's `README.md` for full reproduction instructions.\n\n## Citation\n\n```\n@misc{paohuang2026generativemodelingfluxmatching,\n      title={Generative Modeling with Flux Matching}, \n      author={Peter Pao-Huang and Xiaojie Qiu and Stefano Ermon},\n      year={2026},\n      eprint={2605.07319},\n      archivePrefix={arXiv},\n      primaryClass={cs.LG}\n}\n```","Flux Matching 是一种生成建模范式，用于学习超越得分函数的数据生成向量场。该项目的核心功能是通过自定义的损失函数（如`flux_matching_loss`）来训练模型，从而实现对复杂数据分布的有效建模。技术上基于PyTorch框架，支持多种实验场景，包括可控生成场、RNA速度分析、无限制图像生成以及快速混合采样等。适合于需要深入理解数据生成过程及其动态变化的研究人员和开发者使用，尤其在生物信息学、物理学模拟及图像处理等领域具有广泛应用潜力。",2,"2026-06-11 03:59:24","CREATED_QUERY"]