From: Vsevolod Stakhov Date: Fri, 28 Aug 2020 14:42:32 +0000 (+0100) Subject: [Minor] Neural: Fix PCA-less ANN mode X-Git-Tag: 2.6~102 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d72a81792df5bb6d72da185b6d86765664a2fa7c;p=rspamd.git [Minor] Neural: Fix PCA-less ANN mode --- 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