commit 280877a: [Minor] Neural: Fix vectors lengths checking

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Mar 16 14:14:12 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-03-16 14:10:48 +0000
URL: https://github.com/rspamd/rspamd/commit/280877ab36a377dcd9d06386d399007ae533c398 (HEAD -> master)

[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


More information about the Commits mailing list