Skip to main content
1 of 2
user avatar
user avatar

Supposing that your predictions are always different from zero, since you want to be invariant to the scale, you can optimize the ratio: $$ loss(out, target) = |\frac{pred - target}{target}| $$ or if you want it to be differentiable, you can consider the square: $$ loss(out, target) = \left(\frac{pred - target}{target}\right)^2 $$

Now, those loss are symmetric, therefore overshooting or undershooting is equally penalized

Alberto
  • 1.4k
  • 3
  • 12