pyml.neural_network.loss.softmax_loss_categorical_cross_entropy.Softmax_CategoricalCrossentropy#

class Softmax_CategoricalCrossentropy[source]#

Bases: object

Combined Softmax Activation and Categorical Cross-Entropy loss.

This class defines the backward pass computation for calculating the gradient of the loss with respect to the predicted values when using the Softmax activation and Categorical Cross-Entropy loss.

Variables:

dinputs (numpy.ndarray) – Gradient of the loss with respect to the predicted values.

Methods

__init__

backward

Compute the backward pass to calculate the gradient of the loss with respect to the predicted values.

backward(dvalues, y_true)[source]#

Compute the backward pass to calculate the gradient of the loss with respect to the predicted values.

Return type:

None

Parameters:
  • dvalues (numpy.ndarray) – Gradient of the loss with respect to the predicted values.

  • y_true (numpy.ndarray) – Ground truth values.