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.1.tar.gz (30.9 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.1-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: generative_diffusion-0.1.1.tar.gz
  • Upload date:
  • Size: 30.9 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.1.tar.gz
Algorithm Hash digest
SHA256 eb14f58517ee3d8a362a50f2848be703a407fd4fb25185eff83a9bf9bdbf84e3
MD5 51156c4036aee3f73ef2ffe6215e4aaa
BLAKE2b-256 3e5561e71af8a8f58f695e945771cce5f93eba14423f8eab1850470c00385063

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for generative_diffusion-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6148bac4b3703d8999990a5d9b9c6b103d2a4f93ba8a99e75114957346f75f65
MD5 ed684f71ac90e6fe4432ab011f7a535e
BLAKE2b-256 1758d3eabde20f256508a59e953c6f187db8fb6873140c33c87d7ac3b51ffa82

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