← 开源
dome272

Diffusion-Models-pytorch

Pytorch implementation of Diffusion Models (https://arxiv.org/pdf/2006.11239.pdf)

TutorialsML/AI fundamentalsPython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
1.46k
Star
304
Fork
+-1
本周
1
贡献者
创建于 2022-06-07 · 更新于 2026-10-15 · 今日第 10254 名
主要开发者

dome272/Diffusion-Models-pytorch 排名第 10,254,有 1,464 个星标。

同类别比较

dome272/Diffusion-Models-pytorch 排名第 10,254,此处有 8 个同类条目;twostraws/SwiftAgents 排名第 10,246。

同类别比较
名称排名指标
elicit/machine-learning-list10,230
星标数:
1,473
分叉数:
125
简介:
A curriculum for learning about foundation models, from scratch to the frontier
m2dsupsdlclass/lectures-labs10,231
语言:
Jupyter Notebook
星标数:
1,473
分叉数:
662
简介:
Slides and Jupyter notebooks for the Deep Learning lectures at Master Year 2 Data Science from Institut Polytechnique de Paris
alchaincyf/obsidian-ai-orange-book10,243
星标数:
1,468
分叉数:
134
简介:
Obsidian + Claude Code: Rebuild Your Second Brain with AI · 橙皮书系列 · 用AI重建你的第二大脑
twostraws/SwiftAgents10,246
星标数:
1,467
分叉数:
91
简介:
An AGENTS.md file for Swift and SwiftUI projects.
ikatsov/tensor-house10,262
语言:
Jupyter Notebook
星标数:
1,462
分叉数:
509
简介:
A collection of reference Jupyter notebooks and demo AI/ML applications for enterprise use cases: marketing, pricing, supply chain, smart manufacturing, and more.
Ramakm/AI-Engineering10,268
语言:
Jupyter Notebook
星标数:
1,459
分叉数:
309
简介:
A group of notebooks and other files which can help you learn AI from scratch.
goodfeli/dlbook_exercises10,273
语言:
TeX
星标数:
1,458
分叉数:
341
简介:
Exercises for the Deep Learning textbook at www.deeplearningbook.org
amitkaps/hackermath10,287
语言:
Jupyter Notebook
星标数:
1,452
分叉数:
279
简介:
Introduction to Statistics and Basics of Mathematics for Data Science - The Hacker's Way
关键参数与规格
关键参数与规格
参数值
语言Python
类别Tutorials
子类别ML/AI fundamentals
关键词Image production
星标数1,464
分叉数304
贡献者1
创建日期2022-06-07
更新日期2026-10-15
1 天星标数0
7 天星标数-1
排名10,254
上次排名10,262
排名变化8
7 天星标排名17,141
上次 7 天星标排名12,602
7 天星标排名变化-4,539
总星标排名8,244
上次总星标排名8,235
总星标排名变化-9
国家Germany
README 摘录

Diffusion Models This is an easy-to-understand implementation of diffusion models within 100 lines of code. Different from other implementations, this code doesn't use the lower-bound formulation for sampling and strictly follows Algorithm 1 from the DDPM paper, which makes it extremely short and easy to follow. Furthermore, the conditional code also implements Classifier-Free-Guidance (CFG) and Exponential-Moving-Average (EMA). Below you can find two explanation videos for the theory behind diffusion models and the implementation

. Train a Diffusion Model on your own data: Unconditional Training 1. (optional) Configure Hyperparameters in 2. (optional) Configure Hyperparameters in 2. Sampling The following examples show how to sample images using the models trained in the video on the Landscape Dataset. You can download the checkpoints for the models here. Unconditional Model Conditional Model This model was trained on CIFAR-10 64x64 with 10 classes A more advanced version of this code can be found here by @tcapelle. It introduces

better logging, faster & more efficient training and other nice features and is also being followed by a nice write-up.

常见问题

记录了多少星标和分叉?

dome272/Diffusion-Models-pytorch 有 1,464 个星标和 304 个分叉。

仓库排名是多少?

dome272/Diffusion-Models-pytorch 排名第 10,254。

记录的语言和类别是什么?

dome272/Diffusion-Models-pytorch 有 1,464 个星标,语言为 Python,类别为 Tutorials。

哪个仓库排名最接近?

dome272/Diffusion-Models-pytorch 与 twostraws/SwiftAgents 比较,后者排名第 10,246,有 1,467 个星标。

README

Diffusion Models

This is an easy-to-understand implementation of diffusion models within 100 lines of code. Different from other implementations, this code doesn't use the lower-bound formulation for sampling and strictly follows Algorithm 1 from the DDPM paper, which makes it extremely short and easy to follow. There are two implementations: conditional and unconditional. Furthermore, the conditional code also implements Classifier-Free-Guidance (CFG) and Exponential-Moving-Average (EMA). Below you can find two explanation videos for the theory behind diffusion models and the implementation.

Train a Diffusion Model on your own data:

Unconditional Training

  1. (optional) Configure Hyperparameters in ddpm.py
  2. Set path to dataset in ddpm.py
  3. python ddpm.py

Conditional Training

  1. (optional) Configure Hyperparameters in ddpm_conditional.py
  2. Set path to dataset in ddpm_conditional.py
  3. python ddpm_conditional.py

Sampling

The following examples show how to sample images using the models trained in the video on the Landscape Dataset. You can download the checkpoints for the models here.

Unconditional Model

    device = "cuda"
    model = UNet().to(device)
    ckpt = torch.load("unconditional_ckpt.pt")
    model.load_state_dict(ckpt)
    diffusion = Diffusion(img_size=64, device=device)
    x = diffusion.sample(model, n=16)
    plot_images(x)

Conditional Model

This model was trained on CIFAR-10 64x64 with 10 classes airplane:0, auto:1, bird:2, cat:3, deer:4, dog:5, frog:6, horse:7, ship:8, truck:9

    n = 10
    device = "cuda"
    model = UNet_conditional(num_classes=10).to(device)
    ckpt = torch.load("conditional_ema_ckpt.pt")
    model.load_state_dict(ckpt)
    diffusion = Diffusion(img_size=64, device=device)
    y = torch.Tensor([6] * n).long().to(device)
    x = diffusion.sample(model, n, y, cfg_scale=3)
    plot_images(x)

A more advanced version of this code can be found here by @tcapelle. It introduces better logging, faster & more efficient training and other nice features and is also being followed by a nice write-up.

排名相邻
同类项目