← 开源
louaaron

Score-Entropy-Discrete-Diffusion

[ICML 2024 Best Paper] Discrete Diffusion Modeling by Estimating the Ratios of the Data Distribution (https://arxiv.org/abs/2310.16834)

Model DevelopmentArchitecturePython
在 GitHub 打开
增长势头
+-124 小时新增 Star-0.1%
747
Star
104
Fork
+0
本周
1
贡献者
创建于 2024-02-21 · 更新于 2026-10-15 · 今日第 19095 名
主要开发者
louaaron

louaaron/Score-Entropy-Discrete-Diffusion 排名第 19,095,有 747 个星标。

同类别比较

louaaron/Score-Entropy-Discrete-Diffusion 排名第 19,095,此处有 8 个同类条目;EleutherAI/sparsify 排名第 19,098。

同类别比较
名称排名指标
kekmodel/FixMatch-pytorch19,073
语言:
Python
星标数:
797
分叉数:
184
简介:
Unofficial PyTorch implementation of "FixMatch: Simplifying Semi-Supervised Learning with Consistency and Confidence"
youngwanLEE/CenterMask19,078
语言:
Python
星标数:
781
分叉数:
122
简介:
[CVPR 2020] CenterMask : Real-Time Anchor-Free Instance Segmentation
geffy/tffm19,079
语言:
Jupyter Notebook
星标数:
776
分叉数:
172
简介:
TensorFlow implementation of an arbitrary order Factorization Machine
maudzung/TTNet-Real-time-Analysis-System-for-Table-Tennis-Pytorch19,084
语言:
Python
星标数:
765
分叉数:
197
简介:
Unofficial implementation of "TTNet: Real-time temporal and spatial video analysis of table tennis" (CVPR 2020)
EleutherAI/sparsify19,098
语言:
Python
星标数:
741
分叉数:
105
简介:
Sparsify transformers with SAEs and transcoders
cardmagic/classifier19,099
语言:
Ruby
星标数:
741
分叉数:
125
简介:
A general classifier module to allow Bayesian and LSI classifications.
primeqa/primeqa19,100
语言:
Python
星标数:
739
分叉数:
57
简介:
The prime repository for state-of-the-art Multilingual Question Answering research and development.
bubbliiiing/Siamese-pytorch19,101
语言:
Python
星标数:
738
分叉数:
157
简介:
这是一个孪生神经网络(Siamese network)的库,可进行图片的相似性比较。
关键参数与规格
关键参数与规格
参数值
语言Python
类别Model Development
子类别Architecture
星标数747
分叉数104
贡献者1
创建日期2024-02-21
更新日期2026-10-15
1 天星标数-1
7 天星标数0
排名19,095
上次排名14,117
排名变化-4,978
7 天星标排名14,382
上次 7 天星标排名10,824
7 天星标排名变化-3,558
总星标排名14,130
上次总星标排名14,087
总星标排名变化-43
README 摘录

Score Entropy Discrete Diffusion This repo contains a PyTorch implementation for the paper Discrete Diffusion Modeling by Estimating the Ratios of the Data Distribution by Aaron Lou, Chenlin Meng and Stefano Ermon. Design Choices This codebase is built modularly to promote future research (as opposed to a more compact framework, which would be better for applications). : the model architecture Installation Simply run which will create a environment with packages installed. 8, and different CUDA versions must be installed manually. The

biggest factor is making sure that the and packages use the same CUDA version (more found here). Working with Pretrained Models Download Models Our pretrained models are hosted on huggingface (small, medium). However, models can also be loaded in locally (say after training). This loading gives the model, as well as the graph and noise (which are used for the loss/sampling setup). Run Sampling We can run sampling using a command We can also sample conditionally using Training New

Models Run Training We provide training code, which can be run with the command This creates a new directory with the following structure (compatible with running sampling experiments locally) Here, is used for reloading the run following interruptions, contains generated images as the run progresses, and contains the run output. Arguments can be added with , with important ones being: Some example commands include Other Features SLURM compatibility To train on slurm, simply run Citation Acknowledgements This repository builds heavily off

of score sde, plaid, and DiT.

常见问题

记录了多少星标和分叉?

louaaron/Score-Entropy-Discrete-Diffusion 有 747 个星标和 104 个分叉。

仓库排名是多少?

louaaron/Score-Entropy-Discrete-Diffusion 排名第 19,095。

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

louaaron/Score-Entropy-Discrete-Diffusion 有 747 个星标,语言为 Python,类别为 Model Development。

哪个仓库排名最接近?

louaaron/Score-Entropy-Discrete-Diffusion 与 EleutherAI/sparsify 比较,后者排名第 19,098,有 741 个星标。

README

Score Entropy Discrete Diffusion

This repo contains a PyTorch implementation for the paper Discrete Diffusion Modeling by Estimating the Ratios of the Data Distribution by Aaron Lou, Chenlin Meng and Stefano Ermon.

Design Choices

This codebase is built modularly to promote future research (as opposed to a more compact framework, which would be better for applications). The primary files are

  1. noise_lib.py: the noise schedule
  2. graph_lib: the forward diffusion process
  3. sampling.py: the sampling strategies
  4. model/: the model architecture

Installation

Simply run

conda env create -f environment.yml

which will create a sedd environment with packages installed. Note that this installs with CUDA 11.8, and different CUDA versions must be installed manually. The biggest factor is making sure that the torch and flash-attn packages use the same CUDA version (more found here).

Working with Pretrained Models

Download Models

Our pretrained models are hosted on huggingface (small, medium). However, models can also be loaded in locally (say after training). All functionality is found in load_model.py.

# load in a pretrained model
pretrained_small_model, graph, noise = load_model("louaaron/sedd-small")
pretrained_medium_model, graph, noise = load_model("louaaron/sedd-medium")
# load in a local experiment
local_model, graph, noise = load_model("exp_local/experiment)

This loading gives the model, as well as the graph and noise (which are used for the loss/sampling setup).

Run Sampling

We can run sampling using a command

python run_sample.py --model_path MODEL_PATH --steps STEPS

We can also sample conditionally using

python run_sample_cond.py --model_path MODEL_PATH --step STEPS --prefix PREFIX --suffix SUFFIX

Training New Models

Run Training

We provide training code, which can be run with the command

python run_train.py

This creates a new directory direc=exp_local/DATE/TIME with the following structure (compatible with running sampling experiments locally)

├── direc
│   ├── .hydra
│   │   ├── config.yaml
│   │   ├── ...
│   ├── checkpoints
│   │   ├── checkpoint_*.pth
│   ├── checkpoints-meta
│   │   ├── checkpoint.pth
│   ├── samples
│   │   ├── iter_*
│   │   │   ├── sample_*.txt
│   ├── logs

Here, checkpoints-meta is used for reloading the run following interruptions, samples contains generated images as the run progresses, and logs contains the run output. Arguments can be added with ARG_NAME=ARG_VALUE, with important ones being:

ngpus                     the number of gpus to use in training (using pytorch DDP)
training.accum            number of accumulation steps, set to 1 for small and 2 for medium (assuming an 8x80GB node)
noise.type                one of geometric, loglinear 
graph.type                one of uniform, absorb
model                     one of small, medium
model.scale_by_sigma      set to False if graph.type=uniform (not yet configured)

Some example commands include

# training hyperparameters for SEDD absorb
python train.py noise_lib=loglinear graph.type=absorb model=medium training.accum=2
# training hyperparameters for SEDD uniform
python train.py noise_lib=geometric graph.type=uniform model=small model.scale_by_sigma=False

Other Features

SLURM compatibility

To train on slurm, simply run

python train.py -m args

Citation

@article{lou2024discrete,
  title={Discrete diffusion modeling by estimating the ratios of the data distribution},
  author={Lou, Aaron and Meng, Chenlin and Ermon, Stefano},
  journal={arXiv preprint arXiv:2310.16834},
  year={2024}
}

Acknowledgements

This repository builds heavily off of score sde, plaid, and DiT.

排名相邻
同类项目