add LogCosh loss

This commit is contained in:
Connor Olding 2019-03-22 12:54:44 +01:00
parent 7f1d2afb02
commit 5389ae7fca

View file

@ -135,6 +135,16 @@ class Huber(ResidualLoss):
self.delta * np.sign(r)) self.delta * np.sign(r))
def LogCosh(ResidualLoss):
# essentially a smooth version of Huber loss.
def f(self, r):
return np.log(np.cosh(x))
def df(self, r):
return np.tanh(r)
# more # more
class SomethingElse(ResidualLoss): class SomethingElse(ResidualLoss):