]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Neural: Fix vectors lengths checking
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 16 Mar 2020 14:10:48 +0000 (14:10 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 16 Mar 2020 14:10:48 +0000 (14:10 +0000)
src/plugins/lua/neural.lua

index a508c36b344d7cdd16682911d339406258bfa0e1..37532d99d8ee83e9f4347c3e2a2ca81d916cfc34 100644 (file)
@@ -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