Skip to main content

Toolkit modular en Python para modelos generativos basados en difusión

Project description

Generative‑Diffusion

Python License Demo

Toolkit modular para modelos de difusión generativos (imágenes color) con soporte para:

  • Procesos VE‑SDE, VP‑SDE, SubVP‑SDE
  • Samplers Euler‑Maruyama, Predictor–Corrector, Probability‑Flow ODE, Exponential‑Integrator
  • Noise schedules lineal, coseno, constante
  • Control de generación (class‑conditional, imputación)
  • Métricas FID, IS, BPD

Instalación rápida

pip install generative-diffusion

Ejemplo mínimo

Demo

from generative_diffusion.utils import *
from generative_diffusion.diffusion import ModelFactory
from generative_diffusion.score_networks import ScoreNet

# Crear modelo de difusión utilizando el ModelFactory
diffusion_model = ModelFactory.create(
    score_model_class=ScoreNet,
    is_conditional=True,
    sde_name='ve_sde',
    sampler_name='euler_maruyama',
    # scheduler_name='linear',
)

# Cargar un modelo pre-entrenado
diffusion_model.load_score_model("../checkpoints/Diffusion_model_VESDE_is_conditional_True.pt")

# Generar imágenes
generated_images, labels = diffusion_model.generate(
    n_samples=8,
    n_steps=500,
)
# Mostrar imágenes generadas
show_images(generated_images, title="Dígitos generados con difusión", labels=labels)

Estructura de carpetas

generative_diffusion/   <-- código del paquete
demo_notebooks/         <-- ejemplos de uso
checkpoints/            <-- pesos entrenados opcionales
pyproject.toml
README.md

👥 Autores

Si utilizas este código en tus trabajos, por favor, cita a los autores y enlaza este repositorio.

Desarrollo

  • Formateo: black .
  • Linter: ruff check . --fix

Licencia

MIT

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

generative_diffusion-0.1.3.tar.gz (31.0 kB view details)

Uploaded Source

Built Distribution

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

generative_diffusion-0.1.3-py3-none-any.whl (49.3 kB view details)

Uploaded Python 3

File details

Details for the file generative_diffusion-0.1.3.tar.gz.

File metadata

  • Download URL: generative_diffusion-0.1.3.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.15

File hashes

Hashes for generative_diffusion-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1de01bbec0f36e39cb0c778a3678ac34ddb727056fc795ecd8292d45debea9fb
MD5 4d6e8ed77328a7b5cbbf1e0633a29dac
BLAKE2b-256 949b41ed0b241fbe3383600c1783c89c66406575a0e0a082a75ddfceef06ad84

See more details on using hashes here.

File details

Details for the file generative_diffusion-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for generative_diffusion-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 319d24bf4a15d0bc24040172f95d2a34d580808151a84dd87b859b933666932c
MD5 74a0df5015415ddd8a078f03ed61328f
BLAKE2b-256 e962ed9f2fa7c9b1d3575f8b0233e7123c06868fc7a76b60fe778f1f95ae72ed

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