CategoricalCrossEntropy¶
-
class
CategoricalCrossEntropy¶ Bases:
bluebird.loss.loss.LossCategorical cross entropy.
Example:
loss = CategoricalCrossEntropy() net.build(loss=losss)
-
__init__()¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__()Initialize self.
grad(predicted, actual)Calculates the loss function.
loss(predicted, actual)Calculates the loss function.
-
grad(predicted: numpy.ndarray, actual: numpy.ndarray) → float¶ Calculates the loss function.
- Parameters
predicted (
Tensor) – models outputactual (
Tensor) – expected output
- Returns
gradient
- Return type
float
-
loss(predicted: numpy.ndarray, actual: numpy.ndarray) → float¶ Calculates the loss function.
- Parameters
predicted (
Tensor) – models outputactual (
Tensor) – expected output
- Returns
loss
- Return type
float
-