From: Vsevolod Stakhov Date: Mon, 12 Sep 2016 12:23:25 +0000 (+0100) Subject: [Minor] Set symmetric activation functions for ANN X-Git-Tag: 1.4.0~441 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=591b4c36ea82bd7aeffc2d367d50186cd51e86c9;p=thirdparty%2Frspamd.git [Minor] Set symmetric activation functions for ANN --- diff --git a/src/lua/lua_fann.c b/src/lua/lua_fann.c index 0f20983e05..dd100256e4 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));