W3cubDocs

/TensorFlow

tf.keras.losses.LogCosh

Computes the logarithm of the hyperbolic cosine of the prediction error.

Inherits From: Loss

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

View source

from_config

View source

get_config

View source

__call__

View source

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