Code Monkey home page Code Monkey logo

diffusion_models's Introduction

Denoising diffusion probabilistic models

These tutorials explores the new class of generative models based on diffusion probabilistic models [ 1 ] . This class of models is inspired by considerations from thermodynamics [ 2 ] , but also bears strong ressemblence to denoising score matching [ 3 ] , Langevin dynamics and autoregressive decoding. We will also discuss the more recent development of denoising diffusion implicit models [ 4 ] , which bypass the need for a Markov chain to accelerate the sampling. Stemming from this work, we will also discuss the wavegrad model [ 5 ] , which is based on the same core principles but applies this class of models for audio data.

In order to fully understand the inner workings of diffusion model, we will review all of the correlated topics through tutorial notebooks. These notebooks are available in Pytorch or in JAX (in the jax_tutorials/ folder), thanks to the great contribution of Cristian Garcia.

We split the explanation between four detailed notebooks.

  1. Score matching and Langevin dynamics.
  2. Diffusion probabilistic models and denoising
  3. Applications to waveforms with WaveGrad
  4. Implicit models to accelerate inference

[1] Ho, J., Jain, A., & Abbeel, P. (2020). Denoising diffusion probabilistic models. arXiv preprint arXiv:2006.11239.

[2] Sohl-Dickstein, J., Weiss, E. A., Maheswaranathan, N., & Ganguli, S. (2015). Deep unsupervised learning using nonequilibrium thermodynamics. arXiv preprint arXiv:1503.03585.

[3] Vincent, P. (2011). A connection between score matching and denoising autoencoders. Neural computation, 23(7), 1661-1674.

[4] Song, J., Meng, C., & Ermon, S. (2020). Denoising Diffusion Implicit Models. arXiv preprint arXiv:2010.02502.

[5] Chen, N., Zhang, Y., Zen, H., Weiss, R. J., Norouzi, M., & Chan, W. (2020). WaveGrad: Estimating gradients for waveform generation. arXiv preprint arXiv:2009.00713.

diffusion_models's People

Contributors

acids-ircam avatar cgarciae avatar esling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diffusion_models's Issues

Why shifting alphas_prod_p?

Why do you shift alphas_prod_p in diffusion_02_model.ipynb?

alphas_prod_p = torch.cat([torch.tensor([1]).float(), alphas_prod[:-1]], 0)

n_steps and the final figure

Hello, thank you for your tutorial. It helps me a lot to understand the model. I have got a small question.
Since we set the n_steps to 100, the x_seq contains a random noise and 100 following x for each denoising step. When we plot, we plot the x distribution after every 10 steps. Why in the figure, the labels are from 100 to 1000 rather than 10 to 100? Did I miss something?

Incorrect objective in Jax Denoising Score Matching

def denoising_score_matching(scorenet, samples, key, sigma=0.01):
    noise = jax.random.normal(key, samples.shape)
    perturbed_samples = samples + noise * sigma
    target = -noise / sigma
    scores = scorenet(perturbed_samples)
    loss = 1 / 2. * ((scores - target) ** 2).sum(axis=-1).mean(axis=0)
    return loss

denoising_score_matching(model, data[:10], jax.random.PRNGKey(0))

Here target = -noise/sigma should be replaced with target = -noise

EMA model usage

In notebooks I see updates of EMA model def update, where we change shallow model, but def ema method was never called. It should be called ones per N epochs or it will be used at the end of all training process? As I can see, def update does not affect actual model and smoothing is not happen.

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.