Tensorflow.js tf.losses.computeWeightedLoss() Function
The Tensorflow.js tf.losses.computeWeightedLoss() function calculates the weighted loss between two given tensors.
tf.losses.computeWeightedLoss(losses, weights, reduction)
- losses: It is a tensor of shape.
- weights: These are those tensors whose rank is either 0 or 1, and they must be broad castable to loss of shape.
- reduction: It is the type of reduction to apply to loss. It must be of Reduction type.
Note: The weight, and reduction are optional parameters.
Return value: It returns tf.Tensor.