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

ตัวสร้างกับตัวจำแนก: เกมการแข่งขัน

โครงข่ายสองตัวแข่งขันกันเพื่อพัฒนาให้ดีขึ้น

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

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

Two Networks, One Game

A GAN is two neural networks playing a game: one invents fake data, the other tries to catch it. Their rivalry is what makes both improve. 🎭

Meet the Generator

The generator starts with random noise and shapes it into something that looks like real data, such as a fake face. It never sees the real images directly.

Meet the Discriminator

The discriminator is a judge. It looks at a sample and outputs one number: how likely it thinks that sample is real rather than fake.

Noise In, Image Out

You feed the generator a vector of random numbers called the latent vector. Different vectors produce different outputs, so noise becomes the seed of creativity.

z = torch.randn(1, 100)
fake = generator(z)

A Forger and a Detective

Think of a forger making fake bills and a detective spotting them. Each one pushes the other to get sharper. That tug-of-war is the heart of a GAN.

Real or Fake Label

The discriminator trains on labels: real images get 1 and generated images get 0. It learns to tell the two apart with confidence.

real_label = 1.0
fake_label = 0.0

The Generator's Goal

The generator wins when the discriminator labels its fakes as real. So its goal is to fool the judge, not to copy any single image exactly.

Adversarial Means Opposed

Their objectives are opposite, which is why we call it adversarial. The discriminator wants to be right; the generator wants it to be wrong.

Improving Together

As the discriminator gets pickier, the generator must make better fakes to keep fooling it. This feedback loop lifts both networks over time.

Two Optimizers

Because the players have separate goals, each network gets its own optimizer and updates on its own turn during training.

opt_g = torch.optim.Adam(G.parameters())
opt_d = torch.optim.Adam(D.parameters())

The Goal: Indistinguishable

Training ideally ends when the discriminator can only guess, near 50 percent. At that point the fakes are practically indistinguishable from real data.

Quick Check

Let's make sure the roles are clear.

Recap: The GAN Game

You met both players: a generator that forges data from noise and a discriminator that judges it. Their rivalry drives both to improve. 🎉

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

บทเรียน “ตัวสร้างกับตัวจำแนก: เกมการแข่งขัน” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “ตัวสร้างกับตัวจำแนก: เกมการแข่งขัน” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ 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 ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 1 จากทั้งหมด 4 บทเรียน

บทเรียน “ตัวสร้างกับตัวจำแนก: เกมการแข่งขัน” ใช้เวลานานแค่ไหน

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

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

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

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

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