Use x*x instead of x^2 to calculate square in huber loss implementation. The reason...
authorYuefeng Zhou <yuefengz@google.com>
Sat, 10 Feb 2018 00:14:00 +0000 (16:14 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Sat, 10 Feb 2018 00:24:43 +0000 (16:24 -0800)
commit26114e0dc164a797fcebba149b61a1dde89c3a09
tree5adf02ccd436e7f8457dc4bb189473758acd80eb
parent8ced9faa028ec050516f89f4f542f5aa25f6f3d0
Use x*x instead of x^2 to calculate square in huber loss implementation. The reason is d(x^y)/dy = x^y * log(x) and when x is zero, it becomes NaN. Even if y is constant, the check op would still report failure.

PiperOrigin-RevId: 185208180
tensorflow/python/ops/losses/losses_impl.py