jonbarron / robust_loss_pytorch

A pytorch port of google-research/google-research/robust_loss/
Apache License 2.0
656 stars 88 forks source link

Loss value #2

Closed KeniMardira closed 5 years ago

KeniMardira commented 5 years ago

I have tried implementing this for a project of mine and the loss went negative. Is this expected? Should I take the absolute of my residual before passing it to the loss function?

jonbarron commented 5 years ago

If you call the loss in general.py, it should never go negative. The loss produced by adaptive.py is actually a negative log-likelihood, so it can go negative depending on the value of the scale parameter.

KeniMardira commented 5 years ago

makes perfect sense, thanks for the quick response