diff options
author | jvech <jmvalenciae@unal.edu.co> | 2023-07-27 23:22:30 -0500 |
---|---|---|
committer | jvech <jmvalenciae@unal.edu.co> | 2023-07-27 23:22:30 -0500 |
commit | e9b26e6cae80a089f6b969226a968f5b79a7820b (patch) | |
tree | 31c217a95092e2c2a89d9b4e581a0b4fdfe635a2 /src | |
parent | d8905e0ef4c05f5cea9c6c00cede7492c770e152 (diff) |
fix: weights allocation mistake fixed
Diffstat (limited to 'src')
-rw-r--r-- | src/nn.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -39,8 +39,8 @@ void nn_network_init_weights(Layer layers[], size_t nmemb, size_t n_inputs) for (i = 0; i < nmemb; i++) { - layers[i].weights = calloc(prev_size * layers[i].neurons, sizeof(Layer)); - layers[i].bias = calloc(layers[i].neurons, sizeof(Layer)); + layers[i].weights = calloc(prev_size * layers[i].neurons, sizeof(double)); + layers[i].bias = calloc(layers[i].neurons, sizeof(double)); if (layers[i].weights == NULL || layers[i].bias == NULL) { goto nn_layers_calloc_weights_error; |