Git Product home page Git Product logo

ddpm_tf2's Introduction

TensorFlow2 Implementation of Denoising Diffusion Probabilistic Model

This is a TensorFlow2 implementation (tested on version 2.13.0) of Denoising Diffusion Probabilistic Model (paper and official TF1 implementation).

Features:

  • Can sample images using original checkpoint files (after converting to TF2 format)
  • Full training and sampling workflow
  • Can generate samples with both DDPM and DDIM (with interpolation on latent variables)

Quick Start

Clone this repo

git clone [email protected]:chao-ji/ddpm_tf2.git

Sampling

Prepare Checkpoint files

  1. Download official checkpoint files Download TF1 checkpoint files from this link

  2. Convert to TF2-compatible formats Run python convert_to_tf2_ckpt.py to convert them to TF2-compatible formats

Sample with DDPM

Run

python sample.py --config_path config.yaml --model_path model_path

e.g. python sample.py --config_path cifar10.yaml --model_path cifar10-1 to generate samples.

set --store_prog to True to save intermediate results

Sample with DDIM

Set --use_ddim to True to sample with DDIM

You can get pretty decent results with default parameters (eta being 0 and ddim_steps being 50). Or you can try larger eta values up to 1.0, and ddim_steps up to 1000 (This is when DDIM fall backs to DDPM).

Set --interpolate to True to generate images using latents that are evenly interpolated between two independent latent noises

Training

Run

python train.py --config_path config.yaml --ckpt_path dir_to_checkpoint

for training your own DDPM model.

Samples of generated images


Samples of CIFAR10 images


Samples of CelebAHQ images

See more samples

ddpm_tf2's People

Contributors

chao-ji avatar

Stargazers

 avatar

Watchers

 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.