분류자
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
GAN의 판별자는 단순히 분류기입니다. 생성기에서 만든 데이터와 실제 데이터를 구분하려고 합니다. 분류하는 데이터 유형에 적합한 모든 네트워크 아키텍처를 사용할 수 있습니다.

그림 1: 판별자 학습의 역전파
분류자 학습 데이터
판별자의 학습 데이터는 다음 두 가지 소스에서 가져옵니다.
- 사람의 실제 사진과 같은 실제 데이터 인스턴스 판별자는 학습 중에 이러한 인스턴스를 양성 예로 사용합니다.
- 생성기에서 만든 가짜 데이터 인스턴스입니다. 판별자는 학습 중에 이러한 인스턴스를 제외 예로 사용합니다.
그림 1에서 두 개의 '샘플' 상자는 판별기에 제공되는 두 데이터 소스를 나타냅니다. 구분자 학습 중에는 생성자가 학습하지 않습니다. 판별자가 학습할 예시를 생성하는 동안 가중치는 일정하게 유지됩니다.
분류자 학습
판별기는 두 개의 손실 함수에 연결됩니다. 구분자 학습 중에 구분자는 생성자 손실을 무시하고 구분자 손실만 사용합니다. 다음 섹션에 설명된 대로 생성기 학습 중에 생성기 손실을 사용합니다.
판별자 학습 중:
- 분류자는 생성기의 실제 데이터와 가짜 데이터를 모두 분류합니다.
- 분류자 손실은 실제 인스턴스를 가짜로 또는 가짜 인스턴스를 실제로 잘못 분류한 분류자에게 불이익을 줍니다.
- 판별자는 판별자 네트워크를 통한 판별자 손실에서 백프로파게이션을 통해 가중치를 업데이트합니다.
다음 섹션에서는 생성기 손실이 판별기에 연결되는 이유를 알아봅니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 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."]]