GAN 结构概览
生成对抗网络 (GAN) 由以下两个部分组成:
- 生成器会学习生成合理的数据。生成的实例会成为分类器的负例训练示例。
- 判别器会学习区分生成器的虚假数据与真实数据。如果生成器生成不可信的结果,判别器会对其进行惩罚。
训练开始时,生成器会生成明显虚假的数据,而判别器会快速学会判断这些数据是虚假的:

随着训练的进行,生成器越来越接近生成能够欺骗判别器的输出:

最后,如果生成器训练顺利,鉴别器就越难区分真实和虚假。它会开始将虚假数据归类为真实数据,准确性也会降低。

下面是整个系统的图片:

生成器和判别器都是神经网络。生成器输出直接连接到判别器输入。通过反向传播,分类器的分类会提供一个信号,用于生成器更新其权重。
下面我们来详细介绍一下该系统的各个部分。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-26。
[null,null,["最后更新时间 (UTC):2025-02-26。"],[[["GANs consist of two neural networks: a generator creating data and a discriminator evaluating its authenticity."],["The generator and discriminator are trained against each other, with the generator aiming to produce realistic data and the discriminator aiming to identify fake data."],["Through continuous training, the generator improves its ability to create realistic data, while the discriminator struggles more with differentiation."],["The ultimate goal is for the generator to create data so realistic that the discriminator cannot distinguish it from real data."]]],[]]