Deep Learning Academy · درس

Generator مقابل Discriminator: اللعبة

شبكتان تتنافسان للتحسن

الدرس 1 من 413 خطوة

Generator مقابل Discriminator: اللعبة درس مجاني في Deep Learning Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 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. 🎉

البدء مجانًا

تعلم Python مع معلم ذكاء اصطناعي — مجانًا

اكتب وقم بتشغيل أكوادك الفعلية في المتصفح، واحصل على مساعدة فورية من معلم ذكاء اصطناعي متاح 24/7، واستمر من حيث توقفت على الويب أو في التطبيق.

الدورات
30
الدروس
120

الأسئلة الشائعة

هل درس «Generator مقابل Discriminator: اللعبة» مجاني؟

نعم — نص درس «Generator مقابل Discriminator: اللعبة» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Deep Learning Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Deep Learning Academy 4 دروس في المجموع.

ماذا ستتعلم في «Generator مقابل Discriminator: اللعبة»؟

شبكتان تتنافسان للتحسن تتمرن على Deep Learning Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Deep Learning Academy؟

لا تُشترط خبرة سابقة. Deep Learning Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.

كم من الوقت يستغرق درس «Generator مقابل Discriminator: اللعبة»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Deep Learning Academy هذا؟

نعم. كل درس في Deep Learning Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. Generator مقابل Discriminator: اللعبة
  2. الخسارة التنافسية
  3. بناء DCGAN
  4. انهيار الأنماط وحيل التثبيت
← العودة إلى Deep Learning Academy