הדיסקרימינטור
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
המבדיל ב-GAN הוא פשוט מסווג. הוא מנסה להבדיל בין נתונים אמיתיים לבין הנתונים שנוצרו על ידי הגנרטור. אפשר להשתמש בכל ארכיטקטורת רשת שמתאימה לסוג הנתונים שמסווגים.

איור 1: חזרה לאחור באימון המבדיל.
נתוני אימון של דיסקרימינטור
נתוני האימון של המזהה מגיעים משני מקורות:
- מופעים של נתונים אמיתיים, כמו תמונות אמיתיות של אנשים. במהלך האימון, המזהה משתמש באירועים האלה כדוגמאות חיוביות.
- מופעים של נתונים מזויפים שנוצרו על ידי הגנרטור. במהלך האימון, המזהה משתמש באירועים האלה כדוגמאות שליליות.
באיור 1, שתי התיבות 'דוגמה' מייצגות את שני מקורות הנתונים האלה שמזינים את המזהה. במהלך אימון המבדיל, הגנרטור לא עובר אימון. המשקולות שלו נשארים קבועים בזמן שהוא יוצר דוגמאות לאימון המזהה.
אימון הדיסקרימינטור
המזהה מתחבר לשתי פונקציות loss. במהלך אימון המבדיל, המבדיל מתעלם מהאובדן של הגנרטור ומשתמש רק באובדן של המבדיל. אנחנו משתמשים באובדן האנרגיה של הגנרטורים במהלך אימון הגנרטורים, כפי שמתואר בקטע הבא.
במהלך אימון המבדיל:
- המזהה מסווג גם נתונים אמיתיים וגם נתונים מזויפים מהגנרטור.
- אובדן המזהה (discriminator loss) מעניש את המזהה על סיווג שגוי של מכונה אמיתית כמזויפת או של מכונה מזויפת כמציאותית.
- הדיסקרימינטור מעדכן את המשקלים שלו באמצעות העברה לאחור מהאובדן של הדיסקרימינטור דרך רשת הדיסקרימינטור.
בקטע הבא נסביר למה אובדן האנרגיה של הגנרטור מחובר למבדל.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-02-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-02-26 (שעון UTC)."],[[["\u003cp\u003eThe discriminator in a GAN is a classifier that distinguishes real data from fake data generated by the generator.\u003c/p\u003e\n"],["\u003cp\u003eDiscriminator training involves using real and fake data to update its weights through backpropagation and minimize the discriminator loss.\u003c/p\u003e\n"],["\u003cp\u003eDuring discriminator training, the generator's weights remain constant, and the generator loss is ignored.\u003c/p\u003e\n"]]],[],null,["# The Discriminator\n\n\u003cbr /\u003e\n\nThe discriminator in a GAN is simply a classifier. It tries to distinguish real\ndata from the data created by the generator. It could use any network\narchitecture appropriate to the type of data it's classifying.\n\n**Figure 1: Backpropagation in discriminator training.**\n\nDiscriminator Training Data\n---------------------------\n\nThe discriminator's training data comes from\ntwo sources:\n\n- **Real data** instances, such as real pictures of people. The discriminator uses these instances as positive examples during training.\n- **Fake data** instances created by the generator. The discriminator uses these instances as negative examples during training.\n\nIn Figure 1, the two \"Sample\" boxes represent these two data sources feeding\ninto the discriminator. During discriminator training the generator does not\ntrain. Its weights remain constant while it produces examples for the\ndiscriminator to train on.\n\nTraining the Discriminator\n--------------------------\n\nThe discriminator connects to two [loss](/machine-learning/glossary#loss)\nfunctions. During discriminator training, the discriminator ignores the\ngenerator loss and just uses the discriminator loss. We use the generator loss\nduring generator training, as described in [the next section](/machine-learning/gan/generator).\n\nDuring discriminator training:\n\n1. The discriminator classifies both real data and fake data from the generator.\n2. The discriminator loss penalizes the discriminator for misclassifying a real instance as fake or a fake instance as real.\n3. The discriminator updates its weights through [backpropagation](https://developers.google.com/machine-learning/glossary/#b) from the discriminator loss through the discriminator network.\n\nIn the next section we'll see why the generator loss connects to the\ndiscriminator."]]