View source on GitHub |
Computes the logarithm of the hyperbolic cosine of the prediction error.
Inherits From: Loss
tf.keras.losses.LogCosh(
reduction='sum_over_batch_size', name='log_cosh'
)
Formula:
error = y_pred - y_true
logcosh = mean(log((exp(error) + exp(-error))/2), axis=-1)`
where x is the error y_pred - y_true
.
Args | |
---|---|
reduction
|
Type of reduction to apply to loss. Options are "sum" ,
"sum_over_batch_size" or None . Defaults to
"sum_over_batch_size" .
|
name
|
Optional name for the instance. |
Methods
call
call(
y_true, y_pred
)
from_config
@classmethod
from_config( config )
get_config
get_config()
__call__
__call__(
y_true, y_pred, sample_weight=None
)
Call self as a function.