Type LogCosh
Namespace tensorflow.keras.losses
Parent LossFunctionWrapper
Interfaces ILogCosh
Computes the logarithm of the hyperbolic cosine of the prediction error. `logcosh = log((exp(x) + exp(-x))/2)`,
where x is the error `y_pred - y_true`. Usage:
Usage with the `compile` API:
Show Example
l = tf.keras.losses.LogCosh() loss = l([0., 1., 1.], [1., 0., 1.]) print('Loss: ', loss.numpy()) # Loss: 0.289