From 280877ab36a377dcd9d06386d399007ae533c398 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 16 Mar 2020 14:10:48 +0000 Subject: [PATCH] [Minor] Neural: Fix vectors lengths checking --- src/plugins/lua/neural.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/lua/neural.lua b/src/plugins/lua/neural.lua index a508c36b3..37532d99d 100644 --- a/src/plugins/lua/neural.lua +++ b/src/plugins/lua/neural.lua @@ -1059,7 +1059,7 @@ local function maybe_train_existing_ann(worker, ev_base, rule, set, profiles) -- at least (10 * (1 - 0.25)) = 8 trains local max_len = math.max(lua_util.unpack(lua_util.values(lens))) - local len_bias_check_pred = function(l) + local len_bias_check_pred = function(_, l) return l >= rule.train.max_trains * (1.0 - rule.train.classes_bias) end if max_len >= rule.train.max_trains and fun.all(len_bias_check_pred, lens) then @@ -1077,6 +1077,7 @@ local function maybe_train_existing_ann(worker, ev_base, rule, set, profiles) rspamd_logger.debugm(N, rspamd_config, 'checked %s vectors in ANN %s: %s vectors; %s required, need to check other class vectors', what, ann_key, ntrains, rule.train.max_trains) + cont_cb() end end end -- 2.39.5