【问题标题】:use of Tanh() in the output layer of generator network在生成器网络的输出层使用 Tanh()
【发布时间】:2017-11-15 11:00:32
【问题描述】:

我正在研究生成对抗网络。最近,在阅读 Radford 等人的论文时。 here,我发现他们的生成器网络的输出层使用了 Tanh()。 Tanh()的取值范围是(-1, 1),但是双精度格式的图像的像素值在[0, 1]。谁能解释一下为什么在输出层使用 Tanh() 以及生成器如何生成具有适当像素值的图像?

【问题讨论】:

    标签: machine-learning computer-vision deep-learning convolution


    【解决方案1】:

    如果您查看论文的代码,您会看到作者对图像进行了预处理:https://github.com/soumith/dcgan.torch/blob/master/data/donkey_folder.lua#L68,因此图像的值取自[-1, 1]

    然后,在生成部分,他们将图像重新缩放为 [0, 1]:https://github.com/soumith/dcgan.torch/blob/master/generate.lua#L89 中的值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-27
      • 1970-01-01
      • 2020-02-21
      • 1970-01-01
      • 2020-06-07
      • 2019-08-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多