Diffusion Gym
Project description
Diffusion Gym
diffusiongym is a library for reward adaptation of any pre-trained flow model on any data modality.
Installation
In order to install diffusiongym, execute the following command:
pip install diffusiongym
diffusiongym requires PyTorch 2.3.1, and there may be other hard dependencies. Please open an issue if installation fails through the above command.
Molecule environments depend on FlowMol, which currently needs to be installed manually:
pip install git+https://github.com/cristianpjensen/FlowMol.git@8f4c98cbe68111e4e63480b250d925b6d960d3bc
Some image rewards depend on the clip package, which needs to be installed manually as well:
pip install git+https://github.com/openai/CLIP.git
High-level overview
Diffusion and flow models are largely agnostic to their data modality. They only require that the underlying data type supports a small set of operations. Building on this idea, diffusiongym is designed to be fully modular. You only need to provide the following:
- Data type
YourDataTypethat implementsDDProtocol, which defines some functions necessary for interacting with it as a flow model. - Base model
BaseModel[YourDataType], which defines the scheduler, how to sample $p_0$, how to compute the forward pass, and how to preprocess and postprocess data. - Reward function
Reward[YourDataType].
Once these are defined, you can sample from the flow model and apply reward adaptation methods, such as Value Matching.
Documentation
Much more information can be found in the documentation, including tutorials and API references.
Citation
If this library is useful to you, consider citing the following work:
@inproceedings{jensen2026value,
title={Value Matching: Scalable and Gradient-Free Reward-Guided Flow Adaptation},
author={Cristian Perez Jensen and Luca Schaufelberger and Riccardo De Santi and Kjell Jorner and Andreas Krause},
booktitle={The Fourteenth International Conference on Learning Representations},
year={2026},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diffusiongym-2.0.1.tar.gz.
File metadata
- Download URL: diffusiongym-2.0.1.tar.gz
- Upload date:
- Size: 5.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a6df34dad3774c0637d66b023487a190365f87c85331aed21af6ba2e994bbdc
|
|
| MD5 |
91c69914c8f02b5daca981dc156c73a6
|
|
| BLAKE2b-256 |
6e00246cd4bdd2ebd73f45fbcd02c45164a925f2013e8ca75fce0e746b700a5c
|
Provenance
The following attestation bundles were made for diffusiongym-2.0.1.tar.gz:
Publisher:
release.yml on cristianpjensen/diffusiongym
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diffusiongym-2.0.1.tar.gz -
Subject digest:
3a6df34dad3774c0637d66b023487a190365f87c85331aed21af6ba2e994bbdc - Sigstore transparency entry: 1005082019
- Sigstore integration time:
-
Permalink:
cristianpjensen/diffusiongym@035ac5b27f3817dae884987de437bead1ea14eab -
Branch / Tag:
refs/tags/v2.0.1 - Owner: https://github.com/cristianpjensen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@035ac5b27f3817dae884987de437bead1ea14eab -
Trigger Event:
release
-
Statement type:
File details
Details for the file diffusiongym-2.0.1-py3-none-any.whl.
File metadata
- Download URL: diffusiongym-2.0.1-py3-none-any.whl
- Upload date:
- Size: 623.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07d878986fd8ac11a67fe19d9872efdc1763e3311dd8e8a21124a2cc49761110
|
|
| MD5 |
80d1f73daca168ab392f08965d9f56b4
|
|
| BLAKE2b-256 |
e8b487da310372335602fa84d28e8a7febad05f5f9d56a0f24497ce5e1309ef9
|
Provenance
The following attestation bundles were made for diffusiongym-2.0.1-py3-none-any.whl:
Publisher:
release.yml on cristianpjensen/diffusiongym
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diffusiongym-2.0.1-py3-none-any.whl -
Subject digest:
07d878986fd8ac11a67fe19d9872efdc1763e3311dd8e8a21124a2cc49761110 - Sigstore transparency entry: 1005082021
- Sigstore integration time:
-
Permalink:
cristianpjensen/diffusiongym@035ac5b27f3817dae884987de437bead1ea14eab -
Branch / Tag:
refs/tags/v2.0.1 - Owner: https://github.com/cristianpjensen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@035ac5b27f3817dae884987de437bead1ea14eab -
Trigger Event:
release
-
Statement type: