GeneratorとDiscriminator:競争の仕組み
2つのネットワークが競い合いながら改善します
「GeneratorとDiscriminator:競争の仕組み」はCoddyKit上の無料Deep Learning Academyレッスンです。 これはレッスン1/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これは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.0The 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 チューターと学ぶ Python — 無料
ブラウザでリアルコードを書いて実行し、24/7 の AI チューターから瞬時にサポートを受け、ウェブまたはアプリで続きから学習できます。
- コース
- 30
- レッスン
- 120
よくある質問
「GeneratorとDiscriminator:競争の仕組み」レッスンは無料ですか?
はい。「GeneratorとDiscriminator:競争の仕組み」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Deep Learning Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Deep Learning Academyコースには全4レッスンが含まれています。
「GeneratorとDiscriminator:競争の仕組み」で何を学びますか?
2つのネットワークが競い合いながら改善します ブラウザで直接実行するハンズオンコードでDeep Learning Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Deep Learning Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのDeep Learning Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン1/4です。
「GeneratorとDiscriminator:競争の仕組み」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このDeep Learning Academyレッスンでコードを書いて実行できますか?
はい。すべてのDeep Learning Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- GeneratorとDiscriminator:競争の仕組み
- 敵対的損失
- DCGANを構築する
- モード崩壊と安定化の工夫