neuroal_network.c

new_network
print_network - not needed
free_network
This commit is contained in:
Ghost_Element 2023-09-21 09:23:32 +02:00
parent 85ad120d0a
commit e86009ecf5
2 changed files with 13 additions and 0 deletions

View file

@ -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_3 = matrix_create(hidden_size, 1);
//network.bias_output = matrix_create(output_size, 1); // do we need it? //network.bias_output = matrix_create(output_size, 1); // do we need it?
return network; 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 print_network(Neural_Network* network){};
void free_network(Neural_Network* network){ void free_network(Neural_Network* network){

View file

@ -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); Neural_Network* new_network(int input_size, int hidden_size, int output_size, double learning_rate);
//void print_network(Neural_Network* network); //void print_network(Neural_Network* network);
void randomize_network(Neural_Network* network, int scope);
void free_network(Neural_Network* network); void free_network(Neural_Network* network);
void save_network(Neural_Network* network); void save_network(Neural_Network* network);