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'
)
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. |
callcall(
y_true, y_pred
)
from_config@classmethod
from_config(
config
)
get_configget_config()
__call____call__(
y_true, y_pred, sample_weight=None
)
Call self as a function.
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/keras/losses/LogCosh