Skip to content

martaskrt/fkc-diffusion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Feynman-Kac Correctors in Diffusion: Annealing, Guidance, and Product of Experts

arXiv Jupyter

We introduce an efficient and principled method for sampling from a sequence of annealed, geometric-averaged, or product distributions derived from pretrained score-based models. We derive a weighted simulation scheme, which we call Feynman-Kac Correctors (FKCs), based on the celebrated Feynman-Kac, formula by carefully accounting for terms in the appropriate partial differential equations (PDEs). We show the utility of FKC on applications in several domains: classical image generation, multi-conditional molecule design, and sampling from Boltzmann densities.

Image

Code Layout

├── applications
│   ├── molecules
│   │    └── dual_target_sbdd
│   │        - code for generating 3D molecules conditioned on two protein pockets (FKC Product)
│   ├── temperature_annealing
│   │        - code for temperature annealing experiments on 2D GMMs & LJ-13 (FKC Annealing)
│   └── images
│            - coming soon! (FKC CFG)
└── notebooks
        - examples and notebooks for annealing/product on 2D Gaussians

Introduction and Educational Notebooks

Diffusion (diffusion_edu.ipynb): introduction to diffusion models

Annealing (diffusion_annealed.ipynb): toy example of FKC annealing incl. resampling code (prop 3.2)

Product (diffusion_product.ipynb): toy example of FKC product incl. resampling code (prop 3.3)

Experiments

Each experiment has a different procedure and requires installing specific dependencies. Please follow the links below to run the code for each experiment:

Citation

If you find this code useful in your research, please cite the following paper (expand for bibtex):

M. Skreta*, T. Akhound-Sadegh*, V. Ohanesian*, R. Bondesan, A. Aspuru-Guzik, A. Doucet, R. Brekelmans, A. Tong, K. Neklyudov. Feynman-Kac Correctors in Diffusion: Annealing, Guidance, and Product of Experts, 2025.
@article{skreta2025feynman,
  title={Feynman-Kac Correctors in Diffusion: Annealing, Guidance, and Product of Experts},
  author={Skreta, Marta and Akhound-Sadegh, Tara and Ohanesian, Viktor and Bondesan, Roberto and Aspuru-Guzik, Al{\'a}n and Doucet, Arnaud and Brekelmans, Rob and Tong, Alexander and Neklyudov, Kirill},
  journal={arXiv preprint arXiv:2503.02819},
  year={2025}
}

Contribute

We welcome issues and pull requests (especially bug fixes) and contributions. We will try our best to improve readability and answer questions!

Licences

This repo is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •