aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/neural.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-08-28 15:42:32 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-08-28 15:42:32 +0100
commitd72a81792df5bb6d72da185b6d86765664a2fa7c (patch)
tree02a45f46bed85e830a3ad2df0f8d069585a468d2 /src/plugins/lua/neural.lua
parent6d9c4bed090e852b871d74443c8d34c4fa87a56e (diff)
downloadrspamd-d72a81792df5bb6d72da185b6d86765664a2fa7c.tar.gz
rspamd-d72a81792df5bb6d72da185b6d86765664a2fa7c.zip
[Minor] Neural: Fix PCA-less ANN mode
Diffstat (limited to 'src/plugins/lua/neural.lua')
-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 0258fb0b0..225c9895b 100644
--- a/src/plugins/lua/neural.lua
+++ b/src/plugins/lua/neural.lua
@@ -776,7 +776,7 @@ local function spawn_train(worker, ev_base, rule, set, ann_key, ham_vec, spam_ve
lr = rule.train.learning_rate,
max_epoch = rule.train.max_iterations,
cb = train_cb,
- pca = set.ann.pca
+ pca = (set.ann or {}).pca
})
if not ret then
@@ -833,10 +833,10 @@ local function spawn_train(worker, ev_base, rule, set, ann_key, ham_vec, spam_ve
local ann_data = rspamd_util.zstd_compress(data)
local pca_data
+ fill_set_ann(set, ann_key)
if set.ann.pca then
pca_data = rspamd_util.zstd_compress(set.ann.pca:save())
end
- fill_set_ann(set, ann_key)
-- Deserialise ANN from the child process
ann_trained = rspamd_kann.load(data)
local version = (set.ann.version or 0) + 1