Tensorflow.js tf.losses.huberLoss() Function
The Tensorflow.js tf.losses.huberLoss() function calculates the Huber loss between two given tensors.
tf.losses.huberLoss( labels, predictions, weights, delta, reduction );
- labels: It is the ground truth output tensor. It is similar in dimensions to ‘predictions‘.
- predictions: It is the outputs that are being predicted.
- weights: These are those tensors whose rank is either 0 or 1, and they must be broadcastable to loss of shape.
- delta: It is that point throughout where huberLoss converts to linear from quadratic.
- reduction: It is the type of reduction to apply to loss. It must be of Reduction type.
Note: The weights, delta, and reduction are optional parameters.
Return value: It returns tf.Tensor.