diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-12 13:23:25 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-12 13:23:25 +0100 |
commit | 591b4c36ea82bd7aeffc2d367d50186cd51e86c9 (patch) | |
tree | daddec4277a8cd8ff641e10cdf00d3643ca58996 | |
parent | 44ba38e31c3ee6c5773ee805084099d51f7f46f8 (diff) | |
download | rspamd-591b4c36ea82bd7aeffc2d367d50186cd51e86c9.tar.gz rspamd-591b4c36ea82bd7aeffc2d367d50186cd51e86c9.zip |
[Minor] Set symmetric activation functions for ANN
-rw-r--r-- | src/lua/lua_fann.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lua/lua_fann.c b/src/lua/lua_fann.c index 0f20983e0..dd100256e 100644 --- a/src/lua/lua_fann.c +++ b/src/lua/lua_fann.c @@ -113,7 +113,10 @@ lua_fann_create (lua_State *L) layers[i] = luaL_checknumber (L, i + 2); } - f = fann_create_standard_array (nlayers, layers); + f = fann_create_shortcut_array (nlayers, layers); + fann_set_activation_function_hidden (f, FANN_SIGMOID_SYMMETRIC); + fann_set_activation_function_output (f, FANN_SIGMOID_SYMMETRIC); + fann_randomize_weights (f, -0.1, 0.1); if (f != NULL) { pfann = lua_newuserdata (L, sizeof (gpointer)); |