SLIDE 1 From Variational to Deterministic Autoencoders
Antonio Vergari University of California, Los Angeles @tetraduzione
26th August 2020 - UCL - AI Center Seminars
- r the joys of density estimation in latent spaces
Joint work with: Partha Ghosh, Mehdi S.M. Sajjadi, Bernhard Schölkopf, Michael Black
SLIDE 2
Why?
SLIDE 3 Why?
learning time
SLIDE 4 Why?
learning time
the generative modeling paradigm
inference time
SLIDE 5 Variational Autoencoders
(VAEs)
⇒ Generative modeling [Van Den Oord2017, Tolstikhin2019, Razavi2019,...] ⇒ Density Estimation [Kingma2014,Rezende2014,Burda2015,...] ⇒ Disentanglement [Higgings2016, ...]
Kingma, Diederik P., and Max Welling. "Auto-encoding variational bayes." ICLR 2014
SLIDE 6 Variational Autoencoders
(VAEs)
Regularized Autoencoders
(RAEs)
⇒ Generative modeling [Van Den Oord2017, Tolstikhin2019, Razavi2019,...] ⇒ Density Estimation [Kingma2014,Rezende2014,Burda2015,...] ⇒ Disentanglement [Higgings2016, ...]
a simpler alternative for generative modeling
SLIDE 7
! disclaimer !
SLIDE 8
Variational Autoencoders (VAEs)
SLIDE 9
Variational Autoencoders (VAEs)
SLIDE 10
Variational Autoencoders (VAEs)
SLIDE 11
How to train VAEs?
SLIDE 12
How to train VAEs?
SLIDE 13
How to train VAEs?
SLIDE 14
How to train VAEs?
SLIDE 15 Training VAEs: issues
Balancing reconstruction quality and compression [Burda et al. 2015, Tolshkin et al. 2018, ...] Spurious global optima [Dai et al. 2019] Posterior collapse [van den Oord et al. 2018, ...] Prior/aggregate posterior mismatch [Tolshkin et al. 2018, Dai et al. 2019, ...]
SLIDE 16
Issue #1: balancing training
SLIDE 17 Issue #1: balancing training
SLIDE 18 Issue #1: balancing training
Weighting the KL term!
SLIDE 19
Sampling VAEs
SLIDE 20
Sampling VAEs
SLIDE 21
Sampling VAEs
SLIDE 22
Sampling VAEs
SLIDE 23 Sampling VAEs
the aggregate posterior should ideally match the prior!
SLIDE 24
Issue #2: sampling spurious codes
the prior/aggregate posterior mismatch
SLIDE 25
Issue #2: sampling spurious codes
the decoder has a hard time “imagining”
SLIDE 26
Can we do better?
SLIDE 27
Simpler VAEs?
SLIDE 28
Simpler VAEs?
SLIDE 29
Simpler VAEs?
SLIDE 30
Simpler VAEs?
SLIDE 31
Simpler VAEs?
SLIDE 32
Simpler VAEs?
SLIDE 33
Simpler VAEs?
SLIDE 34
Simpler VAEs?
SLIDE 35 How to have a smooth latent space?
ideally,
SLIDE 36
Regularized Autoencoders (RAEs)!
SLIDE 37
Which regularization for RAEs?
SLIDE 38 Which regularization for RAEs?
Gradient penalization [Gulrajani et al. 2017; Mescheder et al. 2018]
SLIDE 39 Which regularization for RAEs?
Gradient penalization [Gulrajani et al. 2017; Mescheder et al. 2018] Spectral normalization [Miyato et al. 2018]
SLIDE 40 Which regularization for RAEs?
Gradient penalization [Gulrajani et al. 2017; Mescheder et al. 2018] Spectral normalization [Miyato et al. 2018] Weight decay [Bishop et al. 1996]
SLIDE 41 RAE for image generation
RAEs generate equally good or better samples and interpolations
RAE+L2 VAE
SLIDE 42 RAE for image generation
even when regularization is implicit!
AE RAE+L2 VAE
SLIDE 43
Common image benchmarks: MNIST
SLIDE 44
Common image benchmarks: CIFAR10
SLIDE 45
Common image benchmarks: CelebA
SLIDE 46
How do we sample from RAEs…?
SLIDE 47
Sampling RAEs…?
SLIDE 48
Ex-Post Density Estimation (XPDE)
SLIDE 49
Ex-Post Density Estimation (XPDE)
SLIDE 50
Which density estimator for XPDE?
SLIDE 51 Which density estimator for XPDE?
...or another VAE!
⇒
VAE training and sampling issues ...are still there!
a SOTA deep generative model e.g. autoregressive model or Flow
[van den Oord et al. 2019, Razavi et al. 2020]
SLIDE 52 Which density estimator for XPDE?
striving for simplicity: just Gaussian Mixture Models
SLIDE 53
Can’t we just do XPDE for VAEs?
SLIDE 54
Can’t we just do XPDE for VAEs?
SLIDE 55
Can’t we just do XPDE for VAEs?
SLIDE 56 Ex-Post Density Estimation (XPDE)
XPDE consistently improves sample quality for all VAE variants
SLIDE 57
Why...does it work?
SLIDE 58 Why...does it work?
ConvNets are very, very, very smooth! [LeCun et al. 1994]
SLIDE 59 Why...does it work?
ConvNets are very, very, very smooth! [LeCun et al. 1994] ...and these datasets are full, full, full of regularities!
SLIDE 60 What about more challenging data?
E.g., generating structured objects like molecules
SLIDE 61 VAEs for molecules?
⇒
Molecule VAE [Bombardelli et al. 2017]
⇒
GrammarVAE (GVAE) [Kusner et al. 2019]
⇒
Constrained Graph VAE (CGVAE) [Liu et al. 2018, ...]
⇒ ...
SLIDE 62 GRAE: RAEifying the Grammar VAE
More accurate generation than Kusner et al. 2017
SLIDE 63
RAEify your VAEs!
RAE VAE
SLIDE 64
RAEify your VAEs!
RAE VAE
SLIDE 65
RAEify your VAEs!
RAE VAE
SLIDE 66
Is this really simple… and new?
SLIDE 67 AEs for generative modeling
MCMC schemes to sample from Contractive [Rifai et al. 2011] and Denoising Autoencoders [Bengio et al. 2009]
SLIDE 68 Other flavours of XPDE
Two-Stage VAEs [Dai et al. 2019]
use another VAE for XPDE
⇒
VAE training and sampling issues ...are still there!
VQ-VAEs [van den Oord et al. 2019,
Razavi et al. 2020] use PixelCNN over discrete latents
⇒
VQ-VAEs are RAEs not VAEs!
SLIDE 69
What did we lose?
SLIDE 70 What did we lose?
Variational Autoencoders
(VAEs)
⇒ Generative modeling ✓ ⇒ Density Estimation ✓ ⇒ Disentanglement ✓
Regularized Autoencoders
(RAEs)
⇒ Generative modeling ✓ ⇒ Density Estimation ? ⇒ Disentanglement ?
SLIDE 71 RAEs for density estimation ?
RAEs (and VQ-VAEs) are like GANs, they are implicit likelihood models!
SLIDE 72 RAEs for density estimation (?)
RAEs (and VQ-VAEs) are like GANs, they are implicit likelihood models! An approximate ELBO can be recovered under some geometric assumptions
SLIDE 73
RAEs for disentanglement (?)
SLIDE 74
Conclusions
SLIDE 75 aiPhones
⇒ Phone capabilities ⇒ aiCloud, aiWatch, aiTunes,... ⇒ 4k Video, ...
SLIDE 76 aiPhones RegularPhone
⇒ Phone capabilities ⇒ aiCloud, aiWatch, aiTunes,... ⇒ 4k Video, ...
what is the simplest model that gets you further?
SLIDE 77
Takeaway #1: RAEify your VAEs!
RAE VAE
SLIDE 78 Takeaway #2: use XPDE!
Boost your VAEs by training a density estimator on the latent codes!
SLIDE 79 Paper Code
https://openreview.net/forum?id=S1g7tpEYDS https://github.com/ParthaEth/Regularized_autoencoders-RAE-