Merge remote-tracking branch 'origin/Development' into Development
This commit is contained in:
commit
c496df2c32
5 changed files with 42 additions and 26 deletions
|
|
@ -115,8 +115,17 @@ Neural_Network* load_network(char* file) {
|
|||
// create a new network to fill with the saved data
|
||||
Neural_Network* saved_network = new_network(input_size, hidden_size, output_size, 0);
|
||||
|
||||
// load matrices from file into struct
|
||||
saved_network->bias_1 = load_next_matrix(save_file);
|
||||
saved_network->weights_1 = load_next_matrix(save_file);
|
||||
saved_network->bias_2 = load_next_matrix(save_file);
|
||||
saved_network->weights_2 = load_next_matrix(save_file);
|
||||
saved_network->bias_3 = load_next_matrix(save_file);
|
||||
saved_network->weights_3 = load_next_matrix(save_file);
|
||||
saved_network->weights_output = load_next_matrix(save_file);
|
||||
|
||||
|
||||
// return saved network
|
||||
fclose(save_file);
|
||||
return saved_network;
|
||||
}
|
||||
|
||||
|
|
@ -162,11 +171,10 @@ Matrix* predict(Neural_Network* network, Matrix* image_data) {
|
|||
//void batch_train_network(Neural_Network* network, Image** images, int size);
|
||||
|
||||
double relu(double input) {
|
||||
if (input < 0){
|
||||
if (input <= 0){
|
||||
return 0.0;
|
||||
}
|
||||
return input;
|
||||
//TODO: relu formel
|
||||
}
|
||||
|
||||
Matrix* softmax(Matrix* matrix) {
|
||||
|
|
|
|||
Reference in a new issue