ตัวเข้ารหัสอัตโนมัติแบบแปรผันและปริภูมิแฝง
สุ่มสร้างข้อมูลใหม่จากการกระจายที่เรียนรู้แล้ว
ตัวเข้ารหัสอัตโนมัติแบบแปรผันและปริภูมิแฝง เป็นบทเรียน Deep Learning Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 3 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน 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_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. 🎉
คำถามที่พบบ่อย
บทเรียน “ตัวเข้ารหัสอัตโนมัติแบบแปรผันและปริภูมิแฝง” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “ตัวเข้ารหัสอัตโนมัติแบบแปรผันและปริภูมิแฝง” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Deep Learning Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Deep Learning Academy มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “ตัวเข้ารหัสอัตโนมัติแบบแปรผันและปริภูมิแฝง”
สุ่มสร้างข้อมูลใหม่จากการกระจายที่เรียนรู้แล้ว คุณปฏิบัติ Deep Learning Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Deep Learning Academy หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน Deep Learning Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 3 จากทั้งหมด 4 บทเรียน
บทเรียน “ตัวเข้ารหัสอัตโนมัติแบบแปรผันและปริภูมิแฝง” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน Deep Learning Academy นี้ได้ไหม
ได้ บทเรียน Deep Learning Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- ตัวเข้ารหัส คอขวด และตัวถอดรหัส
- ตัวเข้ารหัสอัตโนมัติลดสัญญาณรบกวน
- ตัวเข้ารหัสอัตโนมัติแบบแปรผันและปริภูมิแฝง
- ตรวจจับความผิดปกติด้วยความคลาดเคลื่อนในการสร้างกลับ