Done with activation softmax backwards

This commit is contained in:
2026-07-31 19:08:57 +02:00
parent d7b74ab40f
commit 11da534fd6
30 changed files with 3029 additions and 184 deletions
+6
View File
@@ -68,6 +68,12 @@ struct loss{
*/
panic::types::real_t data_loss;
/**
* @brief Matrix for backwards pass
*/
panic::tensor::real_matrix dinputs;
/**
* @brief Default de-constructor
*
@@ -82,9 +82,35 @@ struct loss_categorical_crossentropy: loss{
const panic::tensor::real_matrix& y_pred,
const panic::tensor::real_matrix& y_true);
};
/**
* @brief backward function to calculate from losses
*
* @param y_pred Matrix of model predection.
* @param y_true Vector of true label of data.
*
*/
bool backward(
const panic::tensor::real_matrix& dvalues,
const panic::tensor::uint_vector& y_true);
/**
* @brief backward function to calculate from losses
*
* @param y_pred Matrix of model predection.
* @param y_true Vector of true label of data.
*
* @Note Overloaded if one-shot endcoded
* is used.
*/
bool backward(
const panic::tensor::real_matrix& dvalues,
const panic::tensor::real_matrix& y_true);
};
} // namespace neural_network
} // namespace panic