Skip to main content

Diffusion Gym

Project description

Diffusion Gym

License Code style: ruff

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 YourDataType that implements DDProtocol, 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffusiongym-2.0.tar.gz (5.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

diffusiongym-2.0.0-py3-none-any.whl (622.8 kB view details)

Uploaded Python 3

diffusiongym-2.0-py3-none-any.whl (622.6 kB view details)

Uploaded Python 3

File details

Details for the file diffusiongym-2.0.tar.gz.

File metadata

  • Download URL: diffusiongym-2.0.tar.gz
  • Upload date:
  • Size: 5.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for diffusiongym-2.0.tar.gz
Algorithm Hash digest
SHA256 76772c318791254c7216ff07a1d354dd2010b0afdf9817ba36656cb39cb2ff8a
MD5 04e4c10845774ccaa372fa7c42c49537
BLAKE2b-256 2438b693438aa57f29785a4cff624c5d287159ea73005e723572f34c53087af3

See more details on using hashes here.

File details

Details for the file diffusiongym-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: diffusiongym-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 622.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for diffusiongym-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d60ae8699f4828426c37e96f42dd3651b3d08ff84b2bfa40dea2ddbc0e80d9f
MD5 9cb6dd7facd54b73f16e8698fa178459
BLAKE2b-256 25528a0fa2b31b67b797b16d513c8a0bd7c1916fd452f9bf228a7ef0d2bea63a

See more details on using hashes here.

Provenance

The following attestation bundles were made for diffusiongym-2.0.0-py3-none-any.whl:

Publisher: release.yml on cristianpjensen/diffusiongym

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file diffusiongym-2.0-py3-none-any.whl.

File metadata

  • Download URL: diffusiongym-2.0-py3-none-any.whl
  • Upload date:
  • Size: 622.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for diffusiongym-2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e8545e5dbb90c2763d169d0ac31febddcfc294e110f30b8bd4bbd871aca4b8b
MD5 c047f984249841682fd7be2695d8da7b
BLAKE2b-256 b9f6b6b5d9ae41a819dba4a590b5e7052a026cd5717962e42b0f0bf05d301a0a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page