Supervised learning: Model is trained on example x paired with output y. used in Classification, regression, semantic segmentation, object detection.
Unsupervised learning: Model is trained on example x without y label, used to learn underlying structure of data. Used in Clustering, Dimensionality reduction.
Semi Supervised learning: Model is trained on some examples of x paired with output y + a large amount of unlabeled data.
Self-supervised learning derives prediction targets from the data itself.
Weakly Supervised learning: Training on noisy, incomplete/imprecise labels
Generative modeling: Process of learning the underlying distribution of data so the model can generate new, similar data samples. We try to learn by making super close to .
Usecases:
- can be used for outlier detection
- Allows sampling from data distribution
Latent variable: is a n-dimensional datapoint that is not directly observed, but rather inferred from the data through a model.
If you wanted to describe your appearance to someone and the other person doesn’t knows what you look like, you wouldn’t start stating color of pixel 1, pixel 2, … , pixel n. you would describe high level features that describe a 'group' of pixels such as I have curly hair and green eyes. In other words, each point in the latent space is a representation of some high-dimensional observation
Autoencoders learn representations by reconstructing their inputs through a latent bottleneck.

After the Model is trained, decoder is discarded and encoder is used to generate representations for most usecases
Usecases:
- Image denoising by learning to reconstruct the image
- Non-linear PCA, latent space capture most important features
- Text retrieval by mapping same text to same representation
- Similar image search by mapping similar images to same representation
Variational Autoencoders: learns probabilistic mapping from data to a latent space by modeling the latent variables as distributions

KL Divergence: Gaussian is a common Prior distribution choice for latent variables, Gaussian is imposed using a KL Divergence Regularization term;
- KL regularization constrains the approximate posterior toward the prior.
- Encourages latent posteriors to stay close to the chosen Gaussian prior.
- Encourages a latent organization that is useful for interpolation and sampling.
- A better match between posterior and prior can improve sampling; sample quality still depends on the learned model.
Regularization term is actually KL Divergence
Notation note: σ is standard deviation and σ² is variance. The diagonal-Gaussian KL formula here uses σ² explicitly; confusing those quantities changes the formula.
A VAE regularizes its latent distributions toward a prior, making sampling more systematic than in an ordinary autoencoder. Better reconstruction, interpretability, or generalization are not automatic guarantees.

Latent-space structure
The source asks why the t-SNE projections of ordinary-autoencoder representations overlap. Overlap in a two-dimensional visualization can suggest that classes are not separated in that projection, but t-SNE alone does not establish the full geometry of the original latent space or guarantee that a VAE will separate classes.
- Model learns common features shared by all classes, can generalize better
- provides smooth transition between one-to-another class
Sampling between nearby latent representations can produce new outputs; the quality depends on how well the model has learned that region.
The encoder predicts a mean and variance for the latent distribution conditioned on each input. The reparameterization trick separates random noise from the differentiable parameters.

Now randomness is moved outside the network making the sampling process differentiable with respect to mean and variance.
Latent Perturbation: slowly changing only one dimension of latent variable to explore effect on the generated output
Disentanglement: process of learning Disentangled latent representation where each latent variable encodes a distinct, independent, meaningful variation in the data. (e.g. one latent variable can correspond to head rotation, another to smile another to lighting)
β-VAE (Beta-VAE): encourages the model to learn disentangled latent representations.
Increasing β gives the regularization term more weight relative to reconstruction.
Increasing β strengthens the KL penalty toward the chosen prior. This may encourage disentanglement at the cost of reconstruction quality, but does not guarantee independent semantic factors or a uniform latent distribution.
β is a tunable hyperparameter controlling the strength of the KL regularizer. The disentanglement setting described in these notes usually takes β≥1; β=1 gives the ordinary VAE weighting. Values below one are also possible when selecting a different reconstruction–regularization trade-off.

The approximate posterior q(z|x) is used because the exact posterior p(z|x) contains the generally intractable marginal likelihood p(x).
| Symbol | Meaning |
|---|---|
| x | Observed data |
| z | Latent (hidden) variables |
| p(z) | Prior |
| p(x|z) | Likelihood |
| p(x) | Marginal likelihood or evidence |
| q(z|x) | Approximate posterior |
| p(z|x) | True posterior |
The exact posterior contains the evidence integral p(x), which is generally intractable. Optimizing the ELBO avoids evaluating that integral directly. For fixed generative parameters, raising the ELBO reduces the gap between the approximate and true posterior.
KL divergence and the evidence lower bound
Nonnegative KL divergence makes the ELBO a lower bound on log evidence. Maximizing it balances reconstruction quality against regularization toward the latent prior.
KL to ELBO: integral derivation
Because log p(x) is constant with respect to q for a fixed generative model, minimizing this posterior KL is equivalent to maximizing the ELBO over q.