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.2.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.2-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: generative_diffusion-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 c69b1dd03bba8513abd3f6c39819b1a1c2577793dd637441e8a9c13e6426af78
MD5 1ec1d9ebcf19527137a25425b00fd250
BLAKE2b-256 ae0cb23b6a0f9578c5429a395675484768d0ae1fb095102c481d99467e772baa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for generative_diffusion-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7f2a03f71189725ae8672e2f8d80355a324d9c0548c969b8df9a215e336c9206
MD5 3d68a947251635c32295a25f0b13c5fc
BLAKE2b-256 fe63a355552e50348a4982e6ba1c9481e977543aea689e5b8e1d3ee913458f16

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