Trying do make the backward to work
This commit is contained in:
2026-08-04 21:05:20 +02:00
parent b52c128496
commit 28c1976fb1
6 changed files with 21 additions and 97 deletions
@@ -92,7 +92,7 @@ struct activation_softmax_loss_categorical_crossentropy: loss{
* @param y_true Vector of true label of data.
*
*/
bool forward(const panic::tensor::real_matrix& y_pred, const panic::tensor::uint_vector& y_true);
bool calculate(const panic::tensor::real_matrix& y_pred, const panic::tensor::uint_vector& y_true) override;
/**
* @brief forward function to calculate losses
@@ -103,7 +103,7 @@ struct activation_softmax_loss_categorical_crossentropy: loss{
* @Note Overloaded if one-shot endcoded
* is used.
*/
bool forward(const panic::tensor::real_matrix& y_pred, const panic::tensor::real_matrix& y_true);
bool calculate(const panic::tensor::real_matrix& y_pred, const panic::tensor::real_matrix& y_true) override;
+5
View File
@@ -73,6 +73,11 @@ struct loss{
*/
panic::tensor::real_matrix dinputs;
/**
* @brief Matrix for output of loss function
*/
panic::tensor::real_matrix outputs;
/**
* @brief Default de-constructor
@@ -92,7 +92,7 @@ struct loss_categorical_crossentropy: loss{
*/
bool backward(
const panic::tensor::real_matrix& dvalues,
const panic::tensor::uint_vector& y_true);
const panic::tensor::uint_vector& y_true) override;
/**
* @brief backward function to calculate from losses
@@ -105,7 +105,7 @@ struct loss_categorical_crossentropy: loss{
*/
bool backward(
const panic::tensor::real_matrix& dvalues,
const panic::tensor::real_matrix& y_true);
const panic::tensor::real_matrix& y_true) override;
};