0Pricing
Deep Learning Academy · บทเรียน

การยุบโหมดและเทคนิคทำให้เสถียร

วินิจฉัยและแก้การฝึก GAN ที่ไม่เสถียร

การยุบโหมดและเทคนิคทำให้เสถียร เป็นบทเรียน Deep Learning Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Deep Learning Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Deep Learning Academy มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

GANs Are Hard to Train

GANs are powerful but notoriously fragile. Two networks chasing each other can swing, stall, or collapse. Knowing the failure modes saves you hours. 🧯

What Is Mode Collapse

Mode collapse happens when the generator produces only a few outputs that reliably fool the judge, ignoring the full variety of the real data.

Spotting the Collapse

You spot it when generated samples all look nearly identical, even though your real dataset is rich and diverse. Variety has vanished.

When the Judge Wins Too Fast

If the discriminator gets too strong too quickly, its gradients dry up and the generator stops learning. Balance between the two is everything.

Trick: Label Smoothing

Label smoothing softens the real target from 1.0 to about 0.9. This keeps the discriminator humble and its gradients useful.

real_label = 0.9

Trick: Add Input Noise

Adding a little noise to the discriminator's inputs makes its job slightly harder, which steadies the training game and reduces collapse.

noisy = real + 0.05 * torch.randn_like(real)

Trick: Tune the Optimizer

The DCGAN paper uses Adam with a low learning rate and beta1 set to 0.5. These settings are a reliable starting point.

Adam(params, lr=2e-4, betas=(0.5, 0.999))

Trick: Minibatch Diversity

Minibatch features let the discriminator compare samples within a batch. If they all look the same, it notices, punishing collapse directly.

Trick: Wasserstein Loss

The Wasserstein loss with gradient penalty gives smoother signals than plain cross-entropy, making notoriously unstable GANs far easier to train.

Keep the Two Balanced

Aim for a fair fight. If one network dominates, slow it down or update the other more often. Balance beats any single trick.

Judge by Diversity Too

A healthy GAN makes images that are both sharp and varied. Always check that different latent vectors give genuinely different outputs.

Quick Check

Recognizing the symptom is half the cure.

Recap: Stabilizing GANs

You learned to spot mode collapse and to fight it with label smoothing, input noise, tuned Adam, and a balanced generator-discriminator duo. 💪

คำถามที่พบบ่อย

บทเรียน “การยุบโหมดและเทคนิคทำให้เสถียร” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “การยุบโหมดและเทคนิคทำให้เสถียร” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Deep Learning Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Deep Learning Academy มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “การยุบโหมดและเทคนิคทำให้เสถียร”

วินิจฉัยและแก้การฝึก GAN ที่ไม่เสถียร คุณปฏิบัติ Deep Learning Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Deep Learning Academy หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน Deep Learning Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน

บทเรียน “การยุบโหมดและเทคนิคทำให้เสถียร” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน Deep Learning Academy นี้ได้ไหม

ได้ บทเรียน Deep Learning Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. ตัวสร้างกับตัวจำแนก: เกมการแข่งขัน
  2. ค่าความสูญเสียแบบปฏิปักษ์
  3. สร้าง DCGAN
  4. การยุบโหมดและเทคนิคทำให้เสถียร
← กลับไปที่ Deep Learning Academy