Skip to content

About

This package provides an unified interface for flow-based generative models in Julia. It focusses on Flow matching, normalizing flows, and diffusion models.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Important

The current implementation of the package is a work in progress, expect things to break and change.

GenerativeFlows.jl

This package provides a Julia implementation of flow-based generative models, a unified mathematical framework that includes Normalizing Flows, Flow Matching, and Diffusion Models.

At their core, these models learn to transform noise into data through the simulation of differential equations. They are among the most successful approaches in modern generative AI, powering systems such as Stable Diffusion, Imagen, and AlphaFold.

The idea: generation of data through Flows

Generative modeling can be understood as sampling from a data distribution $p(X)$. Since sampling directly from complex, high-dimensional data is difficult, we instead start from a simple distribution $p(Z_0)$ (often a standard Gaussian) and learn a continuous transformation that maps samples from this initial distribution into realistic data.

Mathematically, this transformation can for example be represented by an ordinary differential equation (ODE):

$$ z_0 \sim p(Z_0) $$ $$ \frac{dz}{dt} = u_t(z_t) $$

Here, the ODE is defined by a vector field $u_t$, whose solution $\phi_t(z_0) = z_0 + \int u_t(z_t)dt$ is called a Flow.

Why Diffusion, Flow Matching, and Normalizing Flows are related

All three model families arise from the same principle of describing Flows through a vector field to transform a probability distribution over time:

Model family Equation type Type Description
Normalizing Flow ODE Simulation-based Deterministic flow transforming noise into data with exact likelihoods through the change-of-variables formula.
Flow matching ODE Simulation-free Learns a vector field to match the ground-truth “data flow” given a user-defined probability path
Diffusion SDE Simulation-free Learns to reverse a noise process by gradually denoising samples given a user-defined variance schedule, turning random noise into structured data.

Each approach can be seen as a different way of specifying and training the same underlying dynamical system that moves particles from simple noise toward complex data distributions.

Important differences

Normalizing Flow models are often more computationally intensive to train since their learning objective requires simulation of the full ODE. In contrast, Flow Matching and Diffusion models can be trained using samples from the marginal distributions of the flow or diffusion process at arbitrary time points, without simulating the entire trajectory during training. These marginal distributions can be obtained through the definition of a probability path, which is a process that describes the gradual interpolation between noise and data.

While both approaches model the evolution of data through time, Flow Matching learns a deterministic transformation (an ODE) that smoothly transports noise into data, whereas Diffusion Models learn a stochastic process (an SDE) that reverses gradual noise corruption. As a result, diffusion models tend to be more robust and cover complex multimodal data better, while flow matching models offer faster, deterministic sampling and a clearer interpretation as a continuous transport map.

About

This package provides an unified interface for flow-based generative models in Julia. It focusses on Flow matching, normalizing flows, and diffusion models.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages