Variational Autoencoder und der latente Raum
Erzeugen Sie neue Daten aus einer gelernten Verteilung.
Variational Autoencoder und der latente Raum ist eine kostenlose Deep Learning Academy-Lektion auf CoddyKit. Dies ist Lektion 3 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Deep Learning Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Deep Learning Academy-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
Beyond Plain Codes
A variational autoencoder, or VAE, does not store one fixed code per input. Instead it learns a smooth, organized latent space you can actually sample from.
Encode to a Distribution
The VAE encoder outputs a mean and a variance instead of a single point. Each input becomes a little cloud of likely latent codes.
mu, logvar = encoder(x)Sample From the Cloud
To get a code, you sample from that cloud using its mean and variance. Sampling adds the randomness that makes the space generative.
The Reparameterization Trick
Random sampling blocks gradients, so the reparameterization trick moves the randomness aside. Now you can still backpropagate through the sample.
std = torch.exp(0.5 * logvar)
z = mu + std * torch.randn_like(std)Two Losses, Not One
A VAE balances two goals: reconstruction loss for accurate rebuilds, plus a term that shapes the latent space. They pull against each other.
The KL Divergence Term
The second loss is the KL divergence. It nudges each cloud toward a standard normal, keeping the latent space tidy and continuous.
kl = -0.5 * torch.sum(1 + logvar - mu**2 - logvar.exp())A Smooth Latent Space
Thanks to the KL term, nearby codes decode to similar outputs. This smoothness means you can walk between points and get sensible results. ✨
Generate Brand-New Data
Because the space is organized, you can sample new codes from a normal distribution and decode them into fresh, never-seen samples.
z = torch.randn(1, latent_dim)
new_sample = decoder(z)Interpolate Between Inputs
Blend two latent codes and decode the mix to morph one input into another. This smooth interpolation is a signature VAE trick.
z = 0.5 * z_a + 0.5 * z_bVAE vs Plain Autoencoder
A plain autoencoder compresses; a VAE compresses and becomes generative. The extra KL term is what unlocks sampling new data.
Tune the Balance
Weighting the KL term, often called beta, controls the tradeoff. Higher beta gives a cleaner space but slightly blurrier reconstructions.
Quick Check
What gives a VAE its generative power?
Recap
A VAE encodes inputs as distributions, samples with the reparameterization trick, and adds a KL term for a smooth space you can sample and interpolate. 🎉
Häufig gestellte Fragen
Ist die Lektion „Variational Autoencoder und der latente Raum“ kostenlos?
Ja — der vollständige Text von „Variational Autoencoder und der latente Raum“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Deep Learning Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Deep Learning Academy-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „Variational Autoencoder und der latente Raum“?
Erzeugen Sie neue Daten aus einer gelernten Verteilung. Du übst Deep Learning Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um Deep Learning Academy zu starten?
Keine Vorkenntnisse erforderlich. Deep Learning Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 3 von 4.
Wie lange dauert die Lektion „Variational Autoencoder und der latente Raum“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser Deep Learning Academy-Lektion Code schreiben und ausführen?
Ja. Jede Deep Learning Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Encoder, Bottleneck und Decoder
- Denoising-Autoencoder
- Variational Autoencoder und der latente Raum
- Anomalieerkennung durch Rekonstruktionsfehler