Giter VIP home page Giter VIP logo

diffrs's Introduction

Diffusion Rejection Sampling (DiffRS) (ICML 2024)

| paper | arXiv | poster |


This repo contains an official PyTorch implementation for the paper "Diffusion Rejection Sampling" in ICML 2024.

Byeonghu Na, Yeongmin Kim, Minsang Park, Donghyeok Shin, Wanmo Kang, and Il-Chul Moon


This paper introduces Diffusion Rejection Sampling (DiffRS), a new diffusion sampling approach that ensures alignment between the reverse transition and the true transition at each timestep.

Illustration of the sampling process for DiffRS. The path with the green background represents the DiffRS sampling process, and the rightmost images are generated when the images are sampled as a base sampler without rejection from the intermediate image. Timesteps are expressed as the noise level ฯƒ from the EDM scheme.

Overview of DiffRS. We sequentially apply the rejection sampling on the pre-trained transition kernel (red) to align the true transition kernel (blue). The acceptance probability is estimated by the time-dependent discriminator.

Requirements

The requirements for this code are the same as DG.

In our experiment, we utilized CUDA 11.4 and PyTorch 1.12.

Diffusion Rejection Sampling

  1. Download the pre-trained diffusion network and the trained discriminator network from DG.
  • Download 'edm-cifar10-32x32-uncond-vp.pkl' at EDM.
  • Download 'DG/checkpoints/ADM_classifier/32x32_classifier.pt' at DG.
  • Download 32x32_classifier.pt at ADM.
  1. Generate DiffRS samples using generate_diffrs.py. For example:
python3 generate_diffrs.py \
    --network checkpoints/pretrained_score/edm-cifar10-32x32-uncond-vp.pkl \
    --outdir=samples/cifar10/diffrs --rej_percentile=0.75 --max_iter=105

Acknowledgements

This work is heavily built upon the code from:

Citation

@inproceedings{na2024diffusion,
  title = 	 {Diffusion Rejection Sampling},
  author =       {Na, Byeonghu and Kim, Yeongmin and Park, Minsang and Shin, Donghyeok and Kang, Wanmo and Moon, Il-Chul},
  booktitle = 	 {Proceedings of the 41st International Conference on Machine Learning},
  pages = 	 {37097--37121},
  year = 	 {2024},
  editor = 	 {Salakhutdinov, Ruslan and Kolter, Zico and Heller, Katherine and Weller, Adrian and Oliver, Nuria and Scarlett, Jonathan and Berkenkamp, Felix},
  volume = 	 {235},
  series = 	 {Proceedings of Machine Learning Research},
  month = 	 {21--27 Jul},
  publisher =    {PMLR},
}

diffrs's People

Contributors

aailabkaist avatar byeonghu-na avatar

Stargazers

 avatar S.PO.I.L.E.R avatar Xinyu Wang avatar  avatar Demin Yu avatar Mang Ning avatar Yuanhong Yu avatar ZHANG XU avatar  avatar Donghyeok Shin avatar  avatar  avatar  avatar

Watchers

 avatar Kostas Georgiou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.