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

how do you decide loss weight? #31

Closed
timemao opened this issue Jul 22, 2019 · 6 comments
Closed

how do you decide loss weight? #31

timemao opened this issue Jul 22, 2019 · 6 comments

Comments

@timemao
Copy link

timemao commented Jul 22, 2019

Hi, you did good work!

But I have trouble with loss weight, the L2-loss(reconstruction loss) finally converge to about 1000 for 16512512*3 [0,1],but the TV-loss calculated from groundtruth illumination map (get by input/gt image) and input is about 10^6, so we cannot place 1 for L2-loss and 2 for Tv-loss.

Any advise?

@wangruixing
Copy link
Collaborator

Did you mean L2 loss is around 1000? tv loss is around 10^6? In tv loss(local smooth loss) function, the input is origin image, the output is the illumination map. Actually, during my training process, the loss is around 0.033. I suggest you can only use the input image pixel divide illumination map at first, then calculate the l2 loss between the predicted image and ground truth. Only use l2 loss and make sure the loss is right at first.

@timemao
Copy link
Author

timemao commented Jul 22, 2019

Could you make sure metrics.py tv-loss code?

@wangruixing
Copy link
Collaborator

It is the local smoothness code, not standard tv loss.

@wangruixing
Copy link
Collaborator

The second parameter is not a predicted image, it is the illumination map.

@timemao
Copy link
Author

timemao commented Jul 22, 2019

Actually I calculate illumination map with


S=min(1.0,max(im1d,im1d./(im2d+0.0001)));


You mean the second parameter not like this? In metrics.py, you use tf.image.rbg_to_grayscale, this function get 1-channal output

@wangruixing
Copy link
Collaborator

You forgot to calculate the mean. tf.reduce_mean. and during processing image, the scale is 0-1.

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