Skip to content

yng87/DDIM.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DDIM.jl

This repository is now merged into Lux.jl examples.

Lux.jl implementation of Denoising Diffusion Implicit Models (arXiv:2010.02502).

The implementation follows the Keras example.

The model generates images from Gaussian noises by denoising iteratively.

Usage

Install Julia and instantiate Project.toml.

Follwoing scripts are tested on a single NVIDIA Tesla T4 instance.

Dataset

Download and extract Dataset images from 102 Category Flower Dataset.

Training

$julia --project train.jl \
    --dataset-dir oxford_flower_102 \ # path to dataset directory containing image files
    --epochs 25 \
    --image-size 96 \
    --batchsize 64 \
    --learning-rate 1e-3 \
    --weight-decay 1e-4 \
    --val-diffusion-steps 80 \
    --output-dir output/train # path to save checkpoint and images

You can also change model hyper parameters. See main function in train.jl.

Image generation

$julia --project generate.jl \
    --checkpoint output/ckpt/checkpoint_25.bson \ # path to checkpoint
    --image-size 96 \
    --num-images 10 \
    --diffusion-steps 80 \
    --output-dir output/generate # path to save images

You can also change model hyper parameters. See main function in generate.jl. The hyper parameters should be the same during training and generation.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages