Clip loss at maximum value

To improve numerical stability.