Skip to main content

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

Project description

Generative‑Diffusion

Python License

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           # desde PyPI
# ó desde el repo
pip install -e .[dev]

Ejemplo mínimo

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.0.tar.gz (3.5 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.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: generative_diffusion-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 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.0.tar.gz
Algorithm Hash digest
SHA256 c14ec164f657226d4bb2074fbc0483297242be5f7b795e6d12ca56e9fd623196
MD5 e72bc4fef89b8164b2e14a05250cb8f0
BLAKE2b-256 2e036531c65acea48b7511dfdd6a1c3075dda91d8b07da5a1b5a12150301e863

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for generative_diffusion-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 628c4ce63683927838e7b0a36ebeb623f211a21d39b7f7f08aa05bf6c04af831
MD5 14dfb8ff4332a90aee21716dbd83ea9a
BLAKE2b-256 3d69c309a4ba495b06aff98965bd400c2c09ad46328641bd385aed1f0bcb14d4

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