Skip to main content

Flow Gym

Project description

Flow Gym

License Code style: ruff

flowgym is a library for reward adaptation of any pre-trained flow model on any data modality.

Installation

In order to install flowgym, execute the following command:

pip install flowgym

If you want access to pre-trained image or molecular generation models, specify them as options:

pip install flowgym[images]
pip install flowgym[molecules]

If you want to run value matching on your environment, you will need to install it:

pip install value_matching

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, flowgym is designed to be fully modular. You only need to provide the following:

  • Data type that implements DataProtocol, which defines basic arithmetic operations, factory methods, and gradient methods.
  • 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

flowgym-1.2.tar.gz (5.8 MB view details)

Uploaded Source

Built Distribution

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

flowgym-1.2-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file flowgym-1.2.tar.gz.

File metadata

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

File hashes

Hashes for flowgym-1.2.tar.gz
Algorithm Hash digest
SHA256 983df4bb21b3b07b2897cd1464a4a376507633b1c7a1d1a912b66147b3633c7f
MD5 12e6b80a080a29838c2bacc92138eb1b
BLAKE2b-256 51935d3bb2c368fd6d7febc7afa0e98ad59a701474f7ea5845bb703f717a1cdb

See more details on using hashes here.

File details

Details for the file flowgym-1.2-py3-none-any.whl.

File metadata

  • Download URL: flowgym-1.2-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for flowgym-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 667ed05c21f7ca68f0458d1f16b1d342f3ed1f75c014ea77f32964e84c8bad66
MD5 56f3b69877fa59378c9ddd161a2704a2
BLAKE2b-256 3446e4c7f703196783214ccebf7f37302bcf862b24940471ee0a957061f29909

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