ตัวแยกแยะใน GAN เป็นเพียงตัวจัดประเภท โดยจะพยายามแยกแยะข้อมูลจริงออกจากข้อมูลที่สร้างโดยเครื่องมือสร้าง โดยใช้สถาปัตยกรรมเครือข่ายใดก็ได้ที่เหมาะสมกับประเภทข้อมูลที่จะจัดประเภท
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 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,["\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\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\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."]]