From: Pragadeesh C Date: Wed, 19 Aug 2020 06:47:49 +0000 (-0400) Subject: [Fix] Change neural plugin's loss function X-Git-Tag: 2.6~126^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F3478%2Fhead;p=rspamd.git [Fix] Change neural plugin's loss function Modified the neural network to use ceb_neg loss function. --- diff --git a/src/plugins/lua/neural.lua b/src/plugins/lua/neural.lua index e3518d3bd..99efe720e 100644 --- a/src/plugins/lua/neural.lua +++ b/src/plugins/lua/neural.lua @@ -342,8 +342,8 @@ local function create_ann(n, nlayers) local nhidden = math.floor((n + 1) / 2) local t = rspamd_kann.layer.input(n) t = rspamd_kann.transform.relu(t) - t = rspamd_kann.transform.tanh(rspamd_kann.layer.dense(t, nhidden)); - t = rspamd_kann.layer.cost(t, 1, rspamd_kann.cost.mse) + t = rspamd_kann.layer.dense(t, nhidden); + t = rspamd_kann.layer.cost(t, 1, rspamd_kann.cost.ceb_neg) return rspamd_kann.new.kann(t) end