aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPragadeesh C <pchandiran@mimecast.com>2020-08-19 02:47:49 -0400
committerPragadeesh C <pchandiran@mimecast.com>2020-08-21 02:41:17 -0400
commit2c873e1d61925293b471f8b4cdb9d6b7d86fac8c (patch)
tree0db254e8e95febd562688b373e445a49ef510f57 /src
parent85acd8afd9d4a38586c6c908dd30c8eb86758fce (diff)
downloadrspamd-2c873e1d61925293b471f8b4cdb9d6b7d86fac8c.tar.gz
rspamd-2c873e1d61925293b471f8b4cdb9d6b7d86fac8c.zip
[Fix] Change neural plugin's loss function
Modified the neural network to use ceb_neg loss function.
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/neural.lua4
1 files changed, 2 insertions, 2 deletions
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