nothinglo / Deep-Photo-Enhancer

TensorFlow implementation of the CVPR 2018 spotlight paper, Deep Photo Enhancer: Unpaired Learning for Image Enhancement from Photographs with GANs
MIT License
794 stars 110 forks source link

Loss function in training code is different from paper. #86

Closed KewJieLong closed 5 years ago

KewJieLong commented 5 years ago

i came across your work of Deep Photo Enhancer. it is truly amazing work. Currently i am trying to re-implement your work. The adversarial loss function in your Tensorflow training code is confusing to me. In your paper, you stated that Adversarial loss for discriminator is unnamed-2 Ad = E[Dx(x)] - E[Dx(x')] + E[Dy(y)] - E[Dy(y')], However in your code, it is E[Dx(x) - D[Dx(x')] + E[Dy(y') - E[Dy(y)].

It that a mistake? or i misunderstood the objective function?

unnamed-3

Same goes to Adversarial loss for generator. In your paper, it is E[Dx(x')] + E[Dy(y')]. but in code, it is E[Dx(x')] - E[Dy(y')].

Look forward to your reply. Thank you.

nothinglo commented 5 years ago

Is this: https://github.com/nothinglo/Deep-Photo-Enhancer/issues/30#issuecomment-439091925 answer your question?

KewJieLong commented 5 years ago

so in your code, u actually set real image as negative and fake image as positive for discriminator B while real image as positive and fake image as negative for discriminator A right?

nothinglo commented 5 years ago

Yes, I remember the setting in my code is that. Thanks.

KewJieLong commented 5 years ago

is that any specific reason to do like that? in term of training performance?

nothinglo commented 5 years ago

No special reason. Just for my convenience.

KewJieLong commented 5 years ago

ok, Thank you very much