Skip to main content

A research-oriented package for diffusion-based generative modeling with modular components

Project description

Diffuse

Denoising Process

A Python package designed for research in diffusion-based generative modeling with modular components that can be easily swapped and combined for experimentation.

Quick Start

from diffuse.diffusion.sde import SDE, LinearSchedule
from diffuse.timer import VpTimer, HeunTimer
from diffuse.integrator import EulerIntegrator, DDIMIntegrator
from diffuse.denoisers.cond import DPSDenoiser

# Define SDE with noise schedule
sde = SDE(beta=LinearSchedule(b_min=0.1, b_max=20.0, T=1.0))
n_steps = 100

# Choose timer
timer = VpTimer(n_steps=n_steps, eps=0.001, tf=1.0)
# timer = HeunTimer(n_steps=n_steps, rho=7.0, sigma_min=0.002, sigma_max=1.0)

# Timer-aware integrator
#integrator = EulerIntegrator(sde=sde, timer=timer)
integrator = DDIMIntegrator(sde=sde, timer=timer)

# DPS with timer
dps = DPSDenoiser(
    sde=sde,
    score=score_fn,
    integrator=integrator,
    forward_model=forward_model
)

# Generate conditional samples
state, trajectory = dps.generate(key, measurement_state, n_steps, n_samples=10)

# Single step
next_state = dps.step(rng_key, state, measurement_state) # x_t -> x_{t-1}

Features

  • Flexible Noising process: Support for various noise schedules and diffusion processes
  • Timer-aware integration: Advanced timing schemes for improved sampling
  • Conditional sampling: DPS (Diffusion Posterior Sampling) and other conditional methods
  • Modular design: Mix and match denoisers, integrators, timers, and forward models
  • Research-focused: Built for experimentation with new diffusion techniques
  • Examples: MNIST, Gaussian mixtures, and other applications

Installation

pip install -e .

Examples

See the examples/ directory for implementations including:

  • MNIST digit generation
  • Gaussian mixture modeling
  • Conditional sampling demonstrations

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

diffuse_jax-0.1.0.tar.gz (32.9 MB view details)

Uploaded Source

Built Distribution

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

diffuse_jax-0.1.0-py3-none-any.whl (77.5 kB view details)

Uploaded Python 3

File details

Details for the file diffuse_jax-0.1.0.tar.gz.

File metadata

  • Download URL: diffuse_jax-0.1.0.tar.gz
  • Upload date:
  • Size: 32.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for diffuse_jax-0.1.0.tar.gz
Algorithm Hash digest
SHA256 af8bd8622647db66d17d5a02578f2a1a0580713b78628feda35f481eb610b9a0
MD5 f94540d7964c04ad0a5df2fc9f4f316a
BLAKE2b-256 8d4520d56788326354767761dd07696d3a23371d8cebcd69507b7ad3d5bf686d

See more details on using hashes here.

File details

Details for the file diffuse_jax-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: diffuse_jax-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 77.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for diffuse_jax-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e32f47836a7c6c6eb31a4ff6eb2302e8b57729a2c588cd506b8be03c17163d5
MD5 0e8379f04fd47e1205af67f8d22c8407
BLAKE2b-256 73df197f718e2b457226d7779652a36296544976ae599bd51b28fe577377354d

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