aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/kann/kann.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-30 09:40:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-30 09:40:58 +0100
commit083e6ac5ce374e1e9759c7998dd04b9525333eb4 (patch)
treefd421968912f3627c501ed6d70ee1bdd4a39a9d2 /contrib/kann/kann.h
parent95edae6494dac4acf6ab19714a45339e515b8c49 (diff)
downloadrspamd-083e6ac5ce374e1e9759c7998dd04b9525333eb4.tar.gz
rspamd-083e6ac5ce374e1e9759c7998dd04b9525333eb4.zip
[Project] Add simple forward propagation function
Diffstat (limited to 'contrib/kann/kann.h')
-rw-r--r--contrib/kann/kann.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/kann/kann.h b/contrib/kann/kann.h
index 7ec748561..af0de5fba 100644
--- a/contrib/kann/kann.h
+++ b/contrib/kann/kann.h
@@ -220,7 +220,10 @@ kad_node_t *kann_layer_rnn2(int *offset, kad_node_t **par, kad_node_t *in, kad_n
kad_node_t *kann_layer_gru2(int *offset, kad_node_t **par, kad_node_t *in, kad_node_t *h0, int rnn_flag);
/* operations on network with a single input node and a single output node */
-int kann_train_fnn1(kann_t *ann, float lr, int mini_size, int max_epoch, int max_drop_streak, float frac_val, int n, float **_x, float **_y);
+typedef void (*kann_train_cb)(int iter, float train_cost, float val_cost, void *ud);
+int kann_train_fnn1(kann_t *ann, float lr, int mini_size, int max_epoch,
+ int max_drop_streak, float frac_val, int n,
+ float **_x, float **_y, kann_train_cb cb, void *ud);
float kann_cost_fnn1(kann_t *a, int n, float **x, float **y);
const float *kann_apply1(kann_t *a, float *x);