log_cosh

Contents

log_cosh#

class brainpy.losses.log_cosh(errors)[source]#

Calculates the log-cosh loss for a set of predictions.

log(cosh(x)) is approximately (x**2) / 2 for small x and abs(x) - log(2) for large x. It is a twice differentiable alternative to the Huber loss. .. rubric:: References

[Chen et al, 2019](https://openreview.net/pdf?id=rkglvsC9Ym)

Parameters:

errors – a vector of arbitrary shape.

Returns:

the log-cosh loss.