deep generative models: gans and vae · deep convolutional generative adversarial networks...

110
Deep Generative Models: GANs and VAE Jakub M. Tomczak AMLAB, Universiteit van Amsterdam Split, Croatia 2017

Upload: others

Post on 21-May-2020

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Deep Generative Models:GANs and VAEJakub M. TomczakAMLAB, Universiteit van AmsterdamSplit, Croatia 2017

Page 2: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Do we need generative modeling?

Page 3: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Do we need generative modeling?

Page 4: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Do we need generative modeling?

Page 5: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Do we need generative modeling?

Page 6: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Do we need generative modeling?

Page 7: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Do we need generative modeling?

Page 8: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Do we need generative modeling?new data

Page 9: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Do we need generative modeling?High probabilityof the blue label.=Highly probabledecision!

new data

Page 10: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Do we need generative modeling?High probabilityof the blue label.=Highly probabledecision!

High probabilityof the blue label.xLow probabilityof the object.=Uncertaindecision!

new data

Page 11: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Generative Modeling● Providing decision is not enough. How to evaluate uncertainty? Distribution of y is only a part of the story.● Generalization problem. Without knowing the distribution of x how we can generalize to new data?● Understanding the problem is crucial (“What I cannot create, I do not understand”, Richard P. Feynman). Properly modeling data is essential to make better decisions.

Page 12: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Generative Modeling● Semi-supervised learning.Use unlabeled data to train a better classifier.

Page 13: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Generative Modeling● Handling missing or distorted data.Reconstruct and/or denoise data.

Page 14: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Generative ModelingImage generation

Real GeneratedCHEN, Xi, et al. Variational lossy autoencoder. arXiv preprint arXiv:1611.02731, 2016.

Page 15: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Generative ModelingSequence generation

Generated

BOWMAN, Samuel R., et al. Generating sentences from a continuous space. arXiv preprint arXiv:1511.06349, 2015.

Page 16: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

How to formulate a generative model?Modeling in high-dimensional space is difficult.

Page 17: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

How to formulate a generative model?Modeling in high-dimensional space is difficult.

Page 18: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

How to formulate a generative model?Modeling in high-dimensional space is difficult. → modeling all dependencies among pixels.

Page 19: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

How to formulate a generative model?Modeling in high-dimensional space is difficult. → modeling all dependencies among pixels.very inefficient!

Page 20: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

How to formulate a generative model?Modeling in high-dimensional space is difficult. → modeling all dependencies among pixels.

A possible solution? → Latent variable modelsvery inefficient!

Page 21: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Latent Variable Models● Latent variable model:

Page 22: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Latent Variable Models● Latent variable model:

First sample z.Second, sample x for given z.

Page 23: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Latent Variable Models● Latent variable model:

First sample z.Second, sample x for given z.

Page 24: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Latent Variable Models● Latent variable model:● If and , then → Factor Analysis. ● What if we take a non-linear transformation of z? → an infinite mixture of Gaussians.

Page 25: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Latent Variable Models● Latent variable model:● If and , then → Factor Analysis. ● What if we take a non-linear transformation of z? → an infinite mixture of Gaussians.Convenient but limiting!

Page 26: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Latent Variable Models● Latent variable model:● If and , then → Factor Analysis. ● What if we take a non-linear transformation of z? → an infinite mixture of Gaussians.

Page 27: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Latent Variable Models● Latent variable model:● If and , then → Factor Analysis. ● What if we take a non-linear transformation of z? → an infinite mixture of Gaussians. Neural network

Page 28: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Deep Generative Models (DGM):Density Network

MacKay, D. J., & Gibbs, M. N. (1999). Density networks. Statistics and neural networks: advances at the interface.Oxford University Press, Oxford, 129-144.

Page 29: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Density NetworkNeural Network

MacKay, D. J., & Gibbs, M. N. (1999). Density networks. Statistics and neural networks: advances at the interface.Oxford University Press, Oxford, 129-144.

Page 30: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Density NetworkNeural NetworkHow to train this model?!

MacKay, D. J., & Gibbs, M. N. (1999). Density networks. Statistics and neural networks: advances at the interface.Oxford University Press, Oxford, 129-144.

Page 31: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Density Network● MC approximation:

where:MacKay, D. J., & Gibbs, M. N. (1999). Density networks. Statistics and neural networks: advances at the interface.Oxford University Press, Oxford, 129-144.

Page 32: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Density Network● MC approximation:

where:MacKay, D. J., & Gibbs, M. N. (1999). Density networks. Statistics and neural networks: advances at the interface.Oxford University Press, Oxford, 129-144.

Sample z many times,apply log-sum-exp trick and maximize log-likelihood.

Page 33: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Density Network● MC approximation:

where:MacKay, D. J., & Gibbs, M. N. (1999). Density networks. Statistics and neural networks: advances at the interface.Oxford University Press, Oxford, 129-144.

Sample z many times,apply log-sum-exp trick and maximize log-likelihood.It scales badly in high dimensional cases!

Page 34: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Density Network

MacKay, D. J., & Gibbs, M. N. (1999). Density networks. Statistics and neural networks: advances at the interface.Oxford University Press, Oxford, 129-144.

PROSLog-likelihood approachEasy samplingTraining using gradient-basedmethodsCONSRequires explicit modelsFails in high dim. cases

Page 35: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Density Network

MacKay, D. J., & Gibbs, M. N. (1999). Density networks. Statistics and neural networks: advances at the interface.Oxford University Press, Oxford, 129-144.

PROSLog-likelihood approachEasy samplingTraining using gradient-basedmethodsCONSRequires explicit modelsFails in high dim. cases

Can we do better?

Page 36: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Let image two agents:

Page 37: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Let image two agents:A fraud

Page 38: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Let image two agents:

An art expertA fraud

Page 39: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Let image two agents:

… and a real artistA fraud An art expert

Page 40: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Let image two agents:

… and a real artistA fraud An art expert

The fraud aims to copy the real artist and cheat the art expert.

Page 41: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Let image two agents:

… and a real artistA fraud An art expert

The expert assessesa painting andgives her opinion.The fraud aims to copy the real artist and cheat the art expert.

Page 42: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Let image two agents:

… and a real artistA fraud An art expert

The expert assessesa painting andgives her opinion.The fraud aims to copy the real artist and cheat the art expert.

The fraud learnsand tries to foolthe expert.

Page 43: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Let image two agents:

Hmmm… fake!

Page 44: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Let image two agents:

Hmmm… fake!

Page 45: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Let image two agents:

Hmmm… Pablo!

Page 46: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Let image two agents:

Hmmm… Pablo!

Page 47: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Page 48: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

generator

Page 49: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

discriminator

Page 50: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

1. Sample z.2. Generate G(z).3. Discriminatewhether givenimage is real orfake.

Page 51: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Formally, the problem is the following:

Page 52: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Formally, the problem is the following:Minimize wrt. generator

Page 53: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Formally, the problem is the following:Maximize wrt. discriminator

Page 54: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Formally, the problem is the following:Once we converge, we can generate imagesthat are almost indistinguishable from realimages.

Page 55: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Goodfellow, I., et al. (2014). Generative adversarial nets. In Advances in neural information processing systems

Formally, the problem is the following:Once we converge, we can generate imagesthat are almost indistinguishable from realimages.BUT training is very unstable...

Page 56: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Generative Adversarial Nets

Salimans, T., Goodfellow, I., Zaremba, W., Cheung, V., Radford, A., & Chen, X. (2016). Improved techniques for training GANs.In Advances in Neural Information Processing Systems (pp. 2234-2242).

Page 57: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: GANsPROSAllows implicit modelsEasy samplingTraining using gradient-basedmethodsWorks in high dim. cases

CONSUnstable trainingDoes not correspond tolikelihood solutionNo clear way for quantita-tive assessmentMissing mode problem

Page 58: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Wasserstein GAN

Arjovsky, M., Chintala, S., & Bottou, L. (2017). Wasserstein GAN. arXiv preprint arXiv:1701.07875.

We can consider an earth-mover distance to formulate GAN-likeoptimization problem as follows:where the discriminator is a 1-Lipshitz function.

Page 59: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Wasserstein GAN

Arjovsky, M., Chintala, S., & Bottou, L. (2017). Wasserstein GAN. arXiv preprint arXiv:1701.07875.

We can consider an earth-mover distance to formulate GAN-likeoptimization problem as follows:where the discriminator is a 1-Lipshitz function.It means we need to clip weights of the discriminator,i.e.,

clip(weights, -c, c).

Page 60: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Wasserstein GAN

Arjovsky, M., Chintala, S., & Bottou, L. (2017). Wasserstein GAN. arXiv preprint arXiv:1701.07875.

We can consider an earth-mover distance to formulate GAN-likeoptimization problem as follows:where the discriminator is a 1-Lipshitz function.

Wasserstein GAN stabilizes training (but other problems remain).

Page 61: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: More GANs (selected)Radford, A., Metz, L., & Chintala, S. (2015). Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434.Deep convolutional generative adversarial networksAuxiliary classifier GANsOdena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis with auxiliary classifier gans. arXiv preprint arXiv:1610.09585.From optimal transport to generative modeling: the VEGAN cookbookBousquet, O., Gelly, S., Tolstikhin, I., Simon-Gabriel, C. J., & Schoelkopf, B. (2017). From optimal transport to generative modeling: the VEGAN cookbook. arXiv preprint arXiv:1705.07642.Bidirectional Generative Adversarial Networks

Donahue, J., Krähenbühl, P., & Darrell, T. (2016). Adversarial feature learning. arXiv preprint arXiv:1605.09782.

Page 62: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Questions?

Page 63: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: so far we haveDensity NetworkDensity Network

Generative Adversarial Net

Page 64: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: so far we haveWorks only for low dim. cases...Inefficient training...Density NetworkDensity Network

Generative Adversarial Net

Page 65: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: so far we haveWorks only for low dim. cases...Works for high dim. cases!Inefficient training...Density NetworkDensity Network

Generative Adversarial Net

Page 66: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: so far we haveWorks only for low dim. cases...Works for high dim. cases!Doesn’t train a distribution...Inefficient training...

Unstable training...Density NetworkDensity Network

Generative Adversarial Net

Page 67: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: so far we haveQUESTIONCan we stick to the log-likelihood approachbut with a simple training procedure?Density NetworkDensity Network

Generative Adversarial Net

Page 68: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: so far we have

Generative Adversarial Net

Density Network

Page 69: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderDensity Network

Generative Adversarial NetVariational Auto-Encoder

Kingma, D. P., & Welling, M. (2013). Auto-encoding Variational Bayes. arXiv preprint arXiv:1312.6114.

Page 70: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderDensity Network

Generative Adversarial NetVariational Auto-Encoder

Encoder Decoder

Kingma, D. P., & Welling, M. (2013). Auto-encoding Variational Bayes. arXiv preprint arXiv:1312.6114.

Page 71: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-Encoder

Page 72: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderVariational posterior

Page 73: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-Encoder

Reconstruction error Regularization

Page 74: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderOur objective it the evidence lower bound.We can approximate it using MC sample.

Page 75: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderOur objective it the evidence lower bound.We can approximate it using MC sample.How to properly calculate gradients (i.e., train the model)?

Page 76: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderPROBLEM: calculating gradient wrt parametersof the variational posterior (i.e., sampling process).

Kingma, D. P., & Welling, M. (2013). Auto-encoding Variational Bayes. arXiv preprint arXiv:1312.6114.

Page 77: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderPROBLEM: calculating gradient wrt parametersof the variational posterior (i.e., sampling process).SOLUTION: use a non-centered parameterization(a.k.a. reparameterization trick).

Kingma, D. P., & Welling, M. (2013). Auto-encoding Variational Bayes. arXiv preprint arXiv:1312.6114.

Page 78: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderPROBLEM: calculating gradient wrt parametersof the variational posterior (i.e., sampling process).SOLUTION: use a non-centered parameterization(a.k.a. reparameterization trick).

Output of a neural networkKingma, D. P., & Welling, M. (2013). Auto-encoding Variational Bayes. arXiv preprint arXiv:1312.6114.

Page 79: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-Encoder

Page 80: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderA deep neural net that outputs parametersof the variational posterior (encoder):

Page 81: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderA deep neural net that outputs parametersof the generator (decoder), e.g., a normal distribution or Bernoulli distribution.

Page 82: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderA prior that regularizes the encoder andtakes part in the generative process.

Page 83: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-Encoder

Page 84: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderFeedforward netsConvolutional netsPixelCNNGated PixelCNN

Page 85: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderNormalizing flowsVolume-preserving flowsGaussian processesStein Particle DescentOperator VI

Feedforward netsConvolutional netsPixelCNNGated PixelCNN

Page 86: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderNormalizing flowsVolume-preserving flowsGaussian processesStein Particle DescentOperator VI

Feedforward netsConvolutional netsPixelCNNGated PixelCNNAuto-regressive PriorObjective PriorStick-Breaking PriorVampPrior

Page 87: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: Variational Auto-EncoderNormalizing flowsVolume-preserving flowsGaussian processesStein Particle DescentOperator VI

Feedforward netsConvolutional netsPixelCNNGated PixelCNNAuto-regressive PriorObjective PriorStick-Breaking PriorVampPriorImportance Weighted AERenyi DivergenceStein Divergence

Page 88: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Improving the posterior

Page 89: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Normalizing flows● Diagonal posterior – insufficient and inflexible.● How to get more flexible posterior?→ apply a series of T invertible transformations.● New objective:

Page 90: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Normalizing flows● Diagonal posterior – insufficient and inflexible.● How to get more flexible posterior?→ apply a series of T invertible transformations.● New objective:

Page 91: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Normalizing flows● Diagonal posterior – insufficient and inflexible.● How to get more flexible posterior?→ apply a series of T invertible transformations.● New objective:

Rezende, D. J., & Mohamed, S. (2015). Variational inference with normalizing flows. arXiv preprint arXiv:1505.05770. ICML 2015

Page 92: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Normalizing flows● Diagonal posterior – insufficient and inflexible.● How to get more flexible posterior?→ apply a series of T invertible transformations.● New objective:Jacobian-determinant: (i) general normalizing flow (|det J| is easy to compute) (ii) volume-preserving flow, i.e., |det J|=1

Page 93: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Normalizing Flow

Rezende, D. J., & Mohamed, S. (2015). Variational inference with normalizing flows. arXiv preprint arXiv:1505.05770. ICML 2015

Page 94: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Normalizing Flow

Rezende, D. J., & Mohamed, S. (2015). Variational inference with normalizing flows. arXiv preprint arXiv:1505.05770. ICML 2015

Page 95: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Extensions of normalizing flows● How to obtain more flexible posterior and preserve |det J|=1?

– using orthogonal matrices → Householder flow● General normalizing flow:

– using autoregressive model → Inverse Autoregressive FlowTomczak, J. M., & Welling, M. (2016). Improving Variational Inference with Householder Flow.arXiv preprint arXiv:1611.09630. NIPS Workshop on Bayesian Deep Learning 2016

Kingma, D. P., Salimans, T., Jozefowicz, R., Chen, X., Sutskever, I., & Welling, M. (2016). Improving Variational Inference with Inverse Autoregressive Flow. NIPS 2016

Page 96: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Improving the decoder

Page 97: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Improving the decoder● Dependency only on z – missing correlations.● How to get more flexible decoderposterior?→ apply autoregressive model

Page 98: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

PixelVAE (PixelCNN + VAE)

Gulrajani, I., Kumar, K., Ahmed, F., Taiga, A. A., Visin, F., Vazquez, D., & Courville, A. (2016). PixelVAE: A latent variable model for natural images. arXiv preprint arXiv:1611.05013.

Page 99: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

PixelVAE (PixelCNN + VAE)

Gulrajani, I., Kumar, K., Ahmed, F., Taiga, A. A., Visin, F., Vazquez, D., & Courville, A. (2016). PixelVAE: A latent variable model for natural images. arXiv preprint arXiv:1611.05013.

Page 100: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Improving the prior

Page 101: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Improving the prior● Standard normal prior – unimodal, too restrictive.● How to get more flexible prior?→ apply autoregressive prior

→ apply variational mixture of posteriors (VampPrior)Chen, X., Kingma, D. P., Salimans, T., Duan, Y., Dhariwal, P., Schulman, J., ... & Abbeel, P. (2016). Variational lossy autoencoder. arXiv preprint arXiv:1611.02731.

Tomczak, J. M., & Welling, M. (2017). VAE with a VampPrior. arXiv preprint arXiv:1705.07120.

Page 102: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Autoregressive prior

Chen, X., Kingma, D. P., Salimans, T., Duan, Y., Dhariwal, P., Schulman, J., ... & Abbeel, P. (2016). Variational lossy autoencoder. arXiv preprint arXiv:1611.02731.

Page 103: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Autoregressive prior

Chen, X., Kingma, D. P., Salimans, T., Duan, Y., Dhariwal, P., Schulman, J., ... & Abbeel, P. (2016). Variational lossy autoencoder. arXiv preprint arXiv:1611.02731.

Page 104: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

VampPrior

Tomczak, J. M., & Welling, M. (2017). VAE with a VampPrior. arXiv preprint arXiv:1705.07120.

Page 105: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Some extensions and applications of VAE● Semi-supervised learning with VAE.● VAE for sequences.● More powerful decoders (using PixelCNN).

Kingma, D. P., Mohamed, S., Rezende, D. J., & Welling, M. (2014). Semi-supervised learning with deep generative models. NIPSBowman, S. R., Vilnis, L., Vinyals, O., Dai, A. M., Jozefowicz, R., & Bengio, S. (2015).Generating sentences from a continuous space. arXiv preprint arXiv:1511.06349.Chung, J., Kastner, K., Dinh, L., Goel, K., Courville, A. C., & Bengio, Y. (2015). A recurrent latentvariable model for sequential data. NIPSGulrajani, I., Kumar, K., Ahmed, F., Taiga, A. A., Visin, F., Vazquez, D., & Courville, A. (2016). PixelVAE: A latent variable model for natural images. arXiv preprint arXiv:1611.05013.Chen, X., Kingma, D. P., Salimans, T., Duan, Y., Dhariwal, P., Schulman, J., ... & Abbeel, P. (2016). Variational lossy autoencoder. arXiv preprint arXiv:1611.02731.

Page 106: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Some extensions and applications of VAE● Applications: graph data● Applications: drug response prediction● Applications: text generation

Kipf, T. N., & Welling, M. (2016). Variational Graph Auto-Encoders. arXiv preprint arXiv:1611.07308. NIPS Workshop

Rampasek, L., & Goldenberg, A. (2017). Dr.VAE: Drug Response Variational Autoencoder.arXiv preprint arXiv:1706.08203.Yang, Z., Hu, Z., Salakhutdinov, R., & Berg-Kirkpatrick, T. (2017). Improved Variational Autoencoders for Text Modeling using Dilated Convolutions. arXiv preprint arXiv:1702.08139.

Berg, R. V. D., Kipf, T. N., & Welling, M. (2017). Graph Convolutional Matrix Completion. arXiv preprint arXiv:1706.02263.

Page 107: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

DGM: VAEPROSLog-likelihood frameworkEasy samplingTraining using gradient-basedmethodsStable trainingDiscovers latent representationCould be easily combined withother probabilistic frameworks

CONSOnly explicit modelsProduces blurry images(?)

Page 108: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

1283 + 1146Number of citations* of seminal papers onGANs and VAE.*According to GoogleScholar, 26.09.2017

Page 109: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

In order to make betterdecisions, we need abetter understandingof reality.=generative modeling

Page 110: Deep Generative Models: GANs and VAE · Deep convolutional generative adversarial networks Auxiliary classifier GANs Odena, A., Olah, C., & Shlens, J. (2016). Conditional image synthesis

Web-page:https://jmtomczak.github.ioCode on github:https://github.com/jmtomczakContact:[email protected]@gmail.com

Part of the presented research was funded by the European Commission within the Marie Skłodowska-Curie Individual Fellowship (Grant No. 702666, ''Deep learning and Bayesian inference for medical imaging'').