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
+14
View File
@@ -56,6 +56,14 @@ namespace panic{
*/
struct layer{
/**
* @brief Emphty output matrix to store layer input
*
* Output shape:
* samples x neuron_count
*/
panic::tensor::real_matrix inputs;
/**
* @brief Emphty output matrix to store layer output
*
@@ -64,6 +72,12 @@ struct layer{
*/
panic::tensor::real_matrix outputs;
/**
* @brief Emphty matrix to store output for backward pass
*
*/
panic::tensor::real_matrix dinputs;
/**
* @brief Default de-constructor
*
+10 -2
View File
@@ -58,6 +58,12 @@ namespace panic{
*/
struct layer_dense : public layer{
/**
* @brief Emphty matrix to store input data
*
*/
panic::tensor::real_matrix ipnuts;
/**
* @brief Emphty weight matrix to store layer weights
*
@@ -65,6 +71,7 @@ struct layer_dense : public layer{
* input_size x neuron_count
*/
panic::tensor::real_matrix weights;
panic::tensor::real_matrix dweights;
/**
* @brief Emphty bias vector to store layer bias
@@ -73,6 +80,7 @@ struct layer_dense : public layer{
* 1 x neuron_count
*/
panic::tensor::real_vector biases;
panic::tensor::real_vector dbiases;
/**
* @brief Empthy constructor
@@ -102,7 +110,7 @@ struct layer_dense : public layer{
*
* @Note Calculates -> outputs = inputs * weights + biases
*/
bool forward(const panic::tensor::real_matrix& inputs);
bool forward(const panic::tensor::real_matrix& input_data);
/**
* @brief Backward function for layer
@@ -111,7 +119,7 @@ struct layer_dense : public layer{
*
* @Note Calculates derivative of forward function.
*/
bool backward(const panic::tensor::real_matrix& dinpus);
bool backward(const panic::tensor::real_matrix& dvalues);
};
} // namespace tensor