Generative AI
  • 📝Outline
  • 🧐Variational Autoencoder (VAE)
  • 🤓Diffusion Model
    • Diffusion Model
    • Latent Diffusion Model
  • 😎Transformer
    • Attention
    • Transformer
    • Switch Transformer
  • 🥸LLM
    • Introduction
    • Fine-tuning LLMs
    • Reinforcement Learning from Human Feedback (RLHF)
    • LLM-powered applications
  • 🤩Multi-modal Foundation Model
    • CLIP
Powered by GitBook
On this page
  • Maximize Likelihood and KL divergence
  • Lower Bound
  • VAE lower Bound of
  • ELBO
  • Minimize the first term
  • Maximize the second term
  • VAE and GMM
  • Problem in VAE

Variational Autoencoder (VAE)

PreviousOutlineNextDiffusion Model

Last updated 1 year ago

Maximize Likelihood and KL divergence

Lower Bound

VAE lower Bound of log⁡Pθ(x)\log P_{\theta}(x)logPθ​(x)

ELBO

Maximizing the likelihood of the observed xxx:

  • P(z)P(\bold{z})P(z): a normal distribution

  • P(x∣z)=N(x;μ(z),σ(z))P(x|\bold{z}) = N(x; \mu(\bold{z}), \sigma(\bold{z}))P(x∣z)=N(x;μ(z),σ(z)), μ(z),σ(z)\mu(\bold{z}), \sigma(\bold{z})μ(z),σ(z) is unknown and going to be estimated.

Loss: L=∑ilog⁡P(x(i))L = \sum_i\log P(x^{(i)})L=∑i​logP(x(i))

It is straightforward to figure out the following:

Then the lower bound LbL_bLb​ could be derived as follows:

  • q(z∣x)q(\bold{z}|x)q(z∣x) is also a normal distribution, which is estimated by a neural network. q(z∣x)=N(z;μ′(x),σ′(x))q(\bold{z}|x)=N(\bold{z}; \mu'(x), \sigma'(x))q(z∣x)=N(z;μ′(x),σ′(x)). In other words, the mean and variance of z\bold{z}z are given by two functions μ′(⋅)\mu'(\cdot)μ′(⋅) and σ′(⋅)\sigma'(\cdot)σ′(⋅), which will be estimated by the ouput of a neural network.

  • maximizing this lower bound needs to minimize KL[q(z∣x)∣∣P(z)]KL[q(\bold{z}|x) || P(\bold{z})]KL[q(z∣x)∣∣P(z)] and maximize the second term, which will be connected with neural networks.

Minimize the first term KL[q(z∣x)∣∣P(z)]KL[q(\bold{z}|x) || P(\bold{z})]KL[q(z∣x)∣∣P(z)]

Maximize the second term

VAE and GMM

Problem in VAE

How to generatePθ(x∣z)P_{\theta}(x|z)Pθ​(x∣z)

🧐
👍
Maximum Likelihood = Minimize KL Divergence