Latent Space Interpolation Visualizer
Run the Latent Space Interpolation Visualizer Fullscreen
Edit the MicroSim with the p5.js editor
About This MicroSim
This visualization demonstrates interpolation in latent space, a key technique in generative models. By smoothly moving between two points in latent space, we can generate intermediate samples that smoothly transition between the endpoints.
How to Use
- Select Points: Click on shapes to select point A (red highlight) and point B (blue highlight)
- Adjust t: Use the slider to move along the interpolation path
- Change Steps: Adjust the number of intermediate samples
- Method: Switch between linear and spherical (SLERP) interpolation
Key Concepts
Latent Space
A latent space is a compressed representation where: - Each point corresponds to a potential generated sample - Nearby points produce similar outputs - The space is typically lower-dimensional than data space
Linear Interpolation
The simplest method walks in a straight line:
Spherical Interpolation (SLERP)
For normalized latent vectors, SLERP maintains constant magnitude:
where \(\theta = \arccos(\mathbf{z}_1 \cdot \mathbf{z}_2)\)
Why SLERP?
- Linear interpolation can pass through low-density regions
- SLERP stays on the "surface" of the latent manifold
- Often produces more realistic intermediate samples
Applications
- Image Morphing: Smooth transitions between faces
- Style Mixing: Blend attributes from different samples
- Data Augmentation: Generate novel training examples
- Exploration: Understand what the model has learned
Lesson Plan
Learning Objectives:
- Understand the concept of latent space in generative models
- Compare linear vs spherical interpolation methods
- Predict how generated outputs change along interpolation paths
Activities:
- Select two very different shapes and observe the transition
- Compare linear vs SLERP paths - when do they differ most?
- Find configurations where interpolation produces unexpected results
Assessment:
- Why might linear interpolation produce unrealistic intermediate samples?
- When would you choose SLERP over linear interpolation?
- How does the number of interpolation steps affect perceived smoothness?