GANs(Generativeadversarial networks,对抗式生成网络)
Generative adversarial networks (GANs) composes of two deep networks, the generator and the discriminator.
The generator generates the image as much closer to the true image as possible to fool the discriminator, via maximizing the cross-entropy loss, i.e., maxlog(D(x′)).
The discriminator tries to distinguish the generated images from the true images, via minimizing the cross-entropy loss, i.e., min−ylogD(x)−(1−y)log(1−D(x)).
对抗式生成网络由Generator和Discriminator两个深度网络组成:
生成器(Generator ):生成器努力使生成的图像更加真实,通过让交叉熵损失函数如log(D(x′))最大,以骗过判别器。。
判别器(Discriminator) :判别器则需要努力对图片进行真假判别,通过让交叉熵损失函数如−ylogD(x)−(1−y)log(1−D(x))最小,以识别出真假。
生成器(Generator )
class net_G(nn.Module):
def init(self)