JuheonYi / WESPE-TensorFlow

TensorFlow implementation of "Weakly Supervised Photo Enhancer for Digital Cameras"
53 stars 10 forks source link

Confusion about the generator loss #3

Open HaiqiangYuan opened 5 years ago

HaiqiangYuan commented 5 years ago

Hi, thank you for your good job.I have one question about generator loss. In your code WESPE.py line 84 and 88,The generator loss

    # color loss (gan, enhanced-dslr)
    self.color_loss = tf.reduce_mean(sigmoid_cross_entropy_with_logits(self.logits_dslr_color, self.logits_enhanced_color))

    # texture loss (gan, enhanced-dslr)
    self.texture_loss = tf.reduce_mean(sigmoid_cross_entropy_with_logits(self.logits_dslr_texture, self.logits_enhanced_texture))

According to Ian J. Goodfellow's paper theory,Why not like this?

    # color loss (gan, enhanced-dslr)
      self.color_loss = tf.reduce_mean(sigmoid_cross_entropy_with_logits(self.logits_enhanced_color,labels=tf.ones_like(self.logits_enhanced_color)))

    # texture loss (gan, enhanced-dslr)
      self.texture_loss = tf.reduce_mean(sigmoid_cross_entropy_with_logits(self.logits_enhanced_texture,labels=tf.ones_like(self.logits_enhanced_texture)))

Thank you very much!

JuheonYi commented 5 years ago

Sorry for the late response. To be precise, I think the texture loss should be as how you pointed out, same as the original GAN paper. Though, I think my code would work effectively the same since discriminator loss is defined to make dslr logits close to 1.

In case you observe better training results when the color & texture loss for generator is modified, please share with me!

Thanks for the comment!