Next up is dropout layers

This commit is contained in:
2026-08-07 18:50:33 +02:00
parent fb59d61ad5
commit 2c802e9e8c
10 changed files with 670 additions and 20 deletions
+15
View File
@@ -39,6 +39,7 @@
#include <tensor/matrix.hpp> // panic::tensor::real_matrix (uint_matrix, int_matrix)
#include <tensor/vector.hpp>
#include <neural_network/layer/trainable_layer.hpp>
namespace panic{
namespace neural_network{
@@ -73,6 +74,11 @@ struct loss{
*/
panic::types::real_t data_loss = 0;
/**
* @brief Regularization loss over a layer.
*/
panic::types::real_t regularization_loss_value = 0;
/**
* @brief Gradient with respect to the loss input.
*
@@ -172,6 +178,15 @@ struct loss{
const panic::tensor::real_matrix& y_pred,
const panic::tensor::real_matrix& y_true);
/**
* @brief Caclculates the regularization loss of a trainable layer
*
*/
bool regularization_loss(const trainable_layer& layer);
};