d3pm

Minimal Implementation of a D3PM in pytorch

https://github.com/cloneofsimo/d3pm

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.8%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

Minimal Implementation of a D3PM in pytorch

Basic Info
Statistics
  • Stars: 212
  • Watchers: 4
  • Forks: 16
  • Open Issues: 6
  • Releases: 0
Created almost 2 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Citation

readme.md

large large

Minimal Implementation of a D3PM (Structured Denoising Diffusion Models in Discrete State-Spaces), in pytorch

small small

Special thanks to fal.ai for the compute resources for this project.

This is minimal (400 LOC), but fully faithful implementation of a D3PM Structured Denoising Diffusion Models in Discrete State-Spaces. in pytorch.

I have tried to keep the code as simple as possible with much comments and explanation that is somewhat lacking on the original jax implementation, so that it is easy to understand. As far as I know, this is the first, faithful reimplementation of D3PM in pytorch. (Please correct me if I am wrong). Of course, this implementation was heavily based on the official implementation.

Difference between this implementation and the official implementation:

  • This one has conditional sampling, so as you can see, generations are class-conditioned.
  • This one uses rather different/simple model architecture.
  • This one simplfies the official implementation very very much, so it is 400 LOC.
  • This one does not use truncated logistic reparameterization, but you can use that if you wish.
  • Only has uniform sample with inverse-linear beta scheudule, but you can change that with couple loc as well.

Usage

Following is completely self-contained example.

bash python d3pm_runner.py

Following uses dit.py, for CIFAR-10 dataset.

bash python d3pm_runner_cifar.py

Requirements

Install torch, torchvision, pillow, tqdm

bash pip install torch torchvision pillow tqdm

Citation

This implementation:

bibtex @misc{d3pm_pytorch, author={Simo Ryu}, title={Minimal Implementation of a D3PM (Structured Denoising Diffusion Models in Discrete State-Spaces), in pytorch}, year={2024}, howpublished={\url{https://github.com/cloneofsimo/d3pm}} }

Original Paper:

bibtex @article{austin2021structured, title={Structured denoising diffusion models in discrete state-spaces}, author={Austin, Jacob and Johnson, Daniel D and Ho, Jonathan and Tarlow, Daniel and Van Den Berg, Rianne}, journal={Advances in Neural Information Processing Systems}, volume={34}, pages={17981--17993}, year={2021} }

Owner

  • Name: Simo Ryu
  • Login: cloneofsimo
  • Kind: user
  • Company: Corca AI

Cats are Turing machines cloneofsimo@gmail.com

Citation (CITATION.cff)

cff-version: 1.2.0
message: "Citations would be appreciated if you end up using this tool! I currently go by Simo Ryu"
authors:
- family-names: "Ryu"
  given-names: "Simo"
  orcid: "https://orcid.org/0009-0008-0017-2677"
title: "Minimal Implementation of a D3PM (Structured Denoising Diffusion Models in Discrete State-Spaces), in pytorch"
version: 0.0.1
date-released: 2024-04
url: "https://github.com/cloneofsimo/d3pm"

GitHub Events

Total
  • Issues event: 5
  • Watch event: 71
  • Issue comment event: 2
  • Fork event: 4
Last Year
  • Issues event: 5
  • Watch event: 71
  • Issue comment event: 2
  • Fork event: 4

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 18
  • Total Committers: 2
  • Avg Commits per committer: 9.0
  • Development Distribution Score (DDS): 0.167
Past Year
  • Commits: 18
  • Committers: 2
  • Avg Commits per committer: 9.0
  • Development Distribution Score (DDS): 0.167
Top Committers
Name Email Commits
Simo Ryu c****o@g****m 15
simo-ryu s****u@n****m 3
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 9
  • Total pull requests: 0
  • Average time to close issues: about 6 hours
  • Average time to close pull requests: N/A
  • Total issue authors: 9
  • Total pull request authors: 0
  • Average comments per issue: 1.33
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 9
  • Pull requests: 0
  • Average time to close issues: about 6 hours
  • Average time to close pull requests: N/A
  • Issue authors: 9
  • Pull request authors: 0
  • Average comments per issue: 1.33
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • vitaminzl (1)
  • fiy2W (1)
  • qixuema (1)
  • hummat (1)
  • toshi-koike-akino (1)
  • SizhuangHe (1)
  • twq0105 (1)
  • QWTforGithub (1)
  • LtECoD (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels