nothinglo/Deep-Photo-Enhancer

There is some errors in calculating losses, Inconsistent with the papers.

TriLoo opened this issue · 4 comments

For example, formula (9) calculates the loss of two generators where addition is used:
image

however, I found the corresponding implementation from TF.py is as following:

netG_train_loss = tf.reduce_mean(netD_netG_train_output1_1) - tf.reduce_mean(netD_netG_train_output2_2)

and I think the code should be:

netG_train_loss =  tf.reduce_mean(netD_netG_train_output1_1) + tf.reduce_mean(netD_netG_train_output2_2)

same thing happens to the calculation of Discriminator:
Paper:
image

code:

netD_train_loss = (-tf.reduce_mean(netD_train_output1_1) + tf.reduce_mean(netD_train_output2_1)) + (-tf.reduce_mean(netD_train_output1_2) + tf.reduce_mean(netD_train_output2_2))

and the correct code may be

netD_train_loss = (-tf.reduce_mean(netD_train_output1_1) + tf.reduce_mean(netD_train_output2_1)) + (-tf.reduce_mean(netD_train_output2_2) +
 tf.reduce_mean(netD_train_output1_2))

any one can give me some advices ?

Please refer to #30 and #86

Hi @TriLoo , could you share the code and model linked by @nothinglo in README.md?
He doesn't look like to maintain link of the code and model.
From your issues, I think you probably have the code. Could you share them?

Thank you.

Hi @TriLoo , could you share the code and model linked by @nothinglo in README.md? He doesn't look like to maintain link of the code and model. From your issues, I think you probably have the code. Could you share them?

Thank you.

I have tried to find the code but failed. It has been a long time gone

Hi @TriLoo , could you share the code and model linked by @nothinglo in README.md? He doesn't look like to maintain link of the code and model. From your issues, I think you probably have the code. Could you share them?
Thank you.

I have tried to find the code but failed. It has been a long time gone

Thank you for your effort!
I'll have to re-implement it :)