我正在研究生成对抗网络(GAN)。在训练的每一步中,我都会调用一个方法generate_noise
,它返回一些随机噪声的张量。
# Generates noise of normal distribution
def generate_noise( shape : tuple ):
noise = tf.random_normal( shape )
return noise
当我调用此方法时,我收到一个随机噪声张量,该张量被提供给生成器网络。我的问题是:
If the generator receives random inputs everytime ( at every step ) , how can it optimise itself to create a meaningful image ( output )?
那么我应该让每一步的噪音保持恒定吗?这意味着,每一步仅传递一个噪声张量。
# Generates noise of normal distribution
noise = tf.random_normal( shape )
def generate_noise( ):
return noise
Should I make the noise constant so that the generator network has to deal with one input and hence it can create a meaningful output?
引用了很多关于GAN的视频和博客。我无法确定噪音是否保持恒定。如有任何帮助,我们将不胜感激。
最佳答案
不,训练期间噪音不应该不保持恒定。对于给定的潜在噪声向量,GAN 只能生成单个图像。如果保持噪声不变,GAN 只能生成一张图像。
您希望噪声保持恒定的唯一情况是,如果您想要可视化GAN 在单个实例的训练过程中的进展情况。
例如,下面的图像就是这样生成的。请注意,在每个点都会生成相同的图像。这是通过在训练期间的不同阶段将相同的输入噪声向量传递给 GAN 来完成的。
关于python-3.x - 给予 GAN 的随机噪声应该保持恒定吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54739388/