add LogCosh loss
This commit is contained in:
parent
7f1d2afb02
commit
5389ae7fca
1 changed files with 10 additions and 0 deletions
10
onn/loss.py
10
onn/loss.py
|
@ -135,6 +135,16 @@ class Huber(ResidualLoss):
|
|||
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
|
||||
|
||||
class SomethingElse(ResidualLoss):
|
||||
|
|
Loading…
Reference in a new issue