Giter Club home page Giter Club logo

diffusion-models's Introduction

diffusion-models: sample implementations of diffusion models in PyTorch

This repository contains sample implementations of diffusion models in PyTorch. The implementations are not production ready, and primarily focus on simplicity and ease of understanding. Sampling from the model is currently slow: on my setup with a RTX 3060, generating 10k samples for calculating FID on the CIFAR10 test set takes about an hour.

An accompanying blog post can be found at The DDPM Model.

Currently only the DDPM model is implemented.

Install

All dependencies can be installed with conda using

conda env create -f conda/environment.yml

You can also perform an editable installation via

conda env create -f conda/environment.yml
conda activate diff-models
pip install -e .

The installation can be tested with either

make test_train_fashion_mnist

or

make test_train_cifar10

which should train a model on the specified dataset for 10 epochs.

Train a Diffusion Model

I don't currently have a config file/make recipe to train a model to convergence for the Fashion MNIST or CIFAR10 datasets (although the model that results from make test_train_fashion_mnist produces pretty good samples already). My guess is that the hyperparameters in the config files should work well.

For now, if you want to adjust the training parameters, you can adjust the configuration in the config folder manually or run the training scripts with the desired command line arguments.

Note that training an unconditional generative model on CIFAR10 to convergence may take a long time; the DDPM paper reported it took approximately 10 hours to train a model to convergence on the equivalent of 8 V100 GPUs (TPU v3-8).

Acknowledgements

Parts of the implementation are based off Phil Wang's PyTorch DDPM implementation and the original Tensorflow implementation by Jonathan Ho and Ajay Jain.

diffusion-models's People

Contributors

dg845 avatar

Watchers

 avatar  avatar

diffusion-models's Issues

Issue with Unidiffuser pipeline implementation in diffusers repository

Hi there,

I'm having some trouble with the Unidiffuser pipeline implementation in the diffusers repository. Specifically, I'm trying to use the sample code provided in the README to generate images using the Unidiffuser pipeline, but all of the images that I'm generating are coming out black, regardless of whether or not I input a prompt.

I was wondering if you could provide me with some guidance on how to properly use the Unidiffuser pipeline, or if there might be a bug in the implementation that's causing this issue.

Thanks in advance for your help!

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.