0Pricing
Deep Learning Academy · レッスン

変分オートエンコーダーと潜在空間

学習した分布から新しいデータをサンプリングします

「変分オートエンコーダーと潜在空間」はCoddyKit上の無料Deep Learning Academyレッスンです。 これはレッスン3/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはDeep Learning Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Deep Learning Academyコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

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_b

VAE 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. 🎉

よくある質問

「変分オートエンコーダーと潜在空間」レッスンは無料ですか?

はい。「変分オートエンコーダーと潜在空間」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Deep Learning Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Deep Learning Academyコースには全4レッスンが含まれています。

「変分オートエンコーダーと潜在空間」で何を学びますか?

学習した分布から新しいデータをサンプリングします ブラウザで直接実行するハンズオンコードでDeep Learning Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Deep Learning Academyを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのDeep Learning Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン3/4です。

「変分オートエンコーダーと潜在空間」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このDeep Learning Academyレッスンでコードを書いて実行できますか?

はい。すべてのDeep Learning Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. Encoder、Bottleneck、Decoder
  2. デノイジングオートエンコーダー
  3. 変分オートエンコーダーと潜在空間
  4. 再構成誤差による異常検知
← Deep Learning Academyに戻る