【问题标题】:How can I track the loss of a DCGAN如何跟踪 DCGAN 的损失
【发布时间】:2020-11-02 05:45:41
【问题描述】:

我正在关注这个https://www.tensorflow.org/tutorials/generative/dcgan#the_discriminator,但我使用的是我自己的图片。我想以某种方式查看损失、准确性和/或其他任何可能对优化网络有用的信息。我现在主要只关心损失。我试图查看类似的示例,其中包括一种显示损失的方法,例如https://machinelearningmastery.com/practical-guide-to-gan-failure-modes/。但是,对于tensorflow DCGAN示例,我仍然不明白如何做到这一点。

要清楚,我有一个损失函数。我只是不知道如何将其打印出来以实际查看发生了什么。

哦,我应该提到我让它在每个时期为每个生成的图像打印“决定”。所以我知道该怎么做。

【问题讨论】:

    标签: python tensorflow tensorflow2.0 image-generation dcgan


    【解决方案1】:

    我最后只是放了。

    noise = tf.random.normal([BATCH_SIZE, noise_dim])
    generated_images = generator(noise, training=True)
    real_output = discriminator(image_batch, training=True)
    fake_output = discriminator(generated_images, training=True)
    gen_loss = generator_loss(fake_output)
    disc_loss = discriminator_loss(real_output, fake_output)
    print(gen_loss)
    print(disc_loss)
    

    进入 train 函数中的 for 循环。

    【讨论】:

      猜你喜欢
      • 2017-09-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多