From e86009ecf5b7bb5fd9c10032dde7e3a1127af107 Mon Sep 17 00:00:00 2001 From: Ghost_Element Date: Thu, 21 Sep 2023 09:23:32 +0200 Subject: [PATCH] neuroal_network.c new_network print_network - not needed free_network --- neuronal_network.c | 12 ++++++++++++ neuronal_network.h | 1 + 2 files changed, 13 insertions(+) diff --git a/neuronal_network.c b/neuronal_network.c index fdcbe08..4682233 100644 --- a/neuronal_network.c +++ b/neuronal_network.c @@ -21,9 +21,21 @@ Neural_Network* new_network(int input_size, int hidden_size, int output_size, do network->bias_3 = matrix_create(hidden_size, 1); //network.bias_output = matrix_create(output_size, 1); // do we need it? + + return network; } +void randomize_network(Neural_Network* network, int scope){ + matrix_randomize(network->weights_1, scope); + matrix_randomize(network->weights_2, scope); + matrix_randomize(network->weights_3, scope); + matrix_randomize(network->weights_output, scope); + matrix_randomize(network->bias_1, scope); + matrix_randomize(network->bias_2, scope); + matrix_randomize(network->bias_3, scope); +} + //void print_network(Neural_Network* network){}; void free_network(Neural_Network* network){ diff --git a/neuronal_network.h b/neuronal_network.h index 96b1ec7..9c8791d 100644 --- a/neuronal_network.h +++ b/neuronal_network.h @@ -29,6 +29,7 @@ static const int MAX_BYTES = 100; Neural_Network* new_network(int input_size, int hidden_size, int output_size, double learning_rate); //void print_network(Neural_Network* network); +void randomize_network(Neural_Network* network, int scope); void free_network(Neural_Network* network); void save_network(Neural_Network* network);