Starting on the model.h, but need to make layer structs and structs for loss and optimizers

This commit is contained in:
2026-05-30 09:13:52 +02:00
parent cb65174cf4
commit edad247227
30 changed files with 1879 additions and 159 deletions
@@ -4,13 +4,17 @@
#include "utils/vector.h"
#include "utils/matrix.h"
#include "Layer.h"
#include "utils/random.h"
#include "random/random.h"
namespace neural_networks{
template <typename T>
struct Dense_Layer{
struct Dense_Layer : Layer<T>{
T weight_regularizer_l1 = {0};
T weight_regularizer_l2 = {0};
@@ -48,7 +52,7 @@ namespace neural_networks{
this->bias_regularizer_l1 = bias_regularizer_l1;
this->bias_regularizer_l2 = bias_regularizer_l2;
weights.random(n_inputs, n_neurons, -1, 1);
weights = numerics::mul( rng::normal(n_inputs, n_neurons, 0.0f, 1.0f), 0.1f);
//weights = numerics::random_matrix(n_inputs, n_neurons, -1, 1);
biases.resize(n_neurons, T{0});