Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Library for reward adaptation of any pre-trained flow model on any data modality. Official codebase for "Value Matching: Scalable and Gradient-Free Reward-Guided Flow Adaptation."

License

Notifications You must be signed in to change notification settings

cristianpjensen/flowgym

Repository files navigation

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.

About

Library for reward adaptation of any pre-trained flow model on any data modality. Official codebase for "Value Matching: Scalable and Gradient-Free Reward-Guided Flow Adaptation."

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages