diff options
author | jvech <jmvalenciae@unal.edu.co> | 2023-08-06 15:13:03 -0500 |
---|---|---|
committer | jvech <jmvalenciae@unal.edu.co> | 2023-08-06 15:13:03 -0500 |
commit | aeb27a882087ee447a155bd589bd3712050a16f5 (patch) | |
tree | 10438ea6c504a6e2c11f87de5e8a17216775ddd4 /src/nn.h | |
parent | 01e3a565780ff27c9acfe85d383f4e3ae5e0e349 (diff) |
add: nn_network_train() added
The function needs to be tested
Diffstat (limited to 'src/nn.h')
-rw-r--r-- | src/nn.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -10,6 +10,11 @@ #include <unistd.h> #include <openblas/cblas.h> +struct Cost { + double (*func)(double labels, double net_out); + double (*dfunc_out)(double labels, double net_out); +}; + struct Activation { double (*func)(double); double (*dfunc)(double); @@ -24,6 +29,12 @@ typedef struct Layer { void nn_network_init_weights(Layer *network, size_t nmemb, size_t input_cols); void nn_network_free_weights(Layer *network, size_t nmemb); +void nn_network_train( + Layer network[], size_t network_size, + double *input, size_t input_shape[2], + double *labels, size_t labels_shape[2], + struct Cost cost, size_t epochs, double alpha); + void nn_layer_map_activation( double (*activation)(double), double *aout, size_t aout_shape[2], |