Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about loss function #45

Open
parkjh688 opened this issue Feb 6, 2021 · 1 comment
Open

Question about loss function #45

parkjh688 opened this issue Feb 6, 2021 · 1 comment

Comments

@parkjh688
Copy link

parkjh688 commented Feb 6, 2021

Hi.
I'm reading the paper and can't understand some part of loss function.
So I have questions about loss function code.

(1) Why didn't you add eps?
y_lum_lin = tf.nn.conv2d(tf.exp(y)-eps, lum_kernel, [1, 1, 1, 1], padding='SAME')

(2) Why did you tf.log twice to y_lum?
y_lum_ = tf.log(y_lum_lin_ + eps)
y_lum = tf.log(y_lum_lin + eps)
x_lum = tf.log(x_lum_lin + eps)

@gabrieleilertsen
Copy link
Owner

Hi. Without exactly remembering all the details, I think this is why:

  1. I usually add some small constant eps when going to the log domain, i.e. x_log = log(x+eps), which would mean that when going back to linear from log you would do x = exp(x_log) - eps

  2. The notation with '' at the end is for the ground truth, so that y and y_lum_lin_ corresponds to the ground truth image and luminance, respectively. y and y_lum_lin, on the other hand, refers to the reconstructed image and luminance, predicted by the network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants