Browse Source

[Fix] neural: default learn_from_controller off (preserve split learning)

Controller learn tasks (/learnspam, /learnham) historically trained only the
classifiers; neural learned from its own scan-time paths (autotrain, ANN-Train,
autolearn). Default train.learn_from_controller to false so that split-learning
behaviour is preserved out of the box: no NEURAL_LEARN_<rule> learn symbol is
registered by default, the learn task stays the lean classifiers-only pipeline,
and learn_needs_check / the check-pass mask remain dormant. Operators opt a rule
into unified learning per rule with train.learn_from_controller = true.
vstakhov-learn-framework
Vsevolod Stakhov 1 month ago
parent
commit
4b70ff2a8b
No known key found for this signature in database GPG Key ID: 7647B6790081437
  1. 16
      lualib/plugins/neural.lua
  2. 8
      src/plugins/lua/neural.lua
  3. 3
      test/functional/configs/neural_learn_task.conf

16
lualib/plugins/neural.lua

@ -68,13 +68,15 @@ local default_options = {
-- means "default to disable_symbols_input" (resolved per-rule at init); set to
-- false to opt out and keep running the full pipeline for forced learns.
forced_learn_minimal_scan = nil,
-- learn_from_controller: when true, a controller learn task (e.g. /learnspam,
-- /learnham) also trains this neural rule -- one corpus push feeds bayes and
-- neural. Only symbols-independent rules (disable_symbols_input) are eligible
-- (a learn task runs no rule symbol). nil means "default to
-- disable_symbols_input" (resolved per-rule at init); set to false to keep a
-- fusion rule out of the controller learn path.
learn_from_controller = nil,
-- learn_from_controller: opt-in (default false) to preserve the historical
-- split-learning behaviour -- by default a controller learn task (/learnspam,
-- /learnham) trains ONLY the classifiers, and neural keeps training from its
-- own scan-time paths (autotrain, ANN-Train, autolearn). Set it to true to
-- also train this rule from controller learn tasks, so one corpus push feeds
-- bayes and neural. A disable_symbols_input rule then trains from the lean
-- learn pipeline; a symbol-dependent rule makes its learn task run a full
-- check pass first (its vector reads symbol scores).
learn_from_controller = false,
},
watch_interval = 60.0,
lock_expire = 600,

8
src/plugins/lua/neural.lua

@ -1789,14 +1789,6 @@ for k, r in pairs(rules) do
rule_elt.train.forced_learn_minimal_scan = rule_elt.disable_symbols_input and true or false
end
-- learn_from_controller defaults ON for symbols-independent rules (so a
-- /learnspam corpus push trains them alongside bayes) and OFF otherwise.
-- Operators can set it to false to keep a fusion rule out of the controller
-- learn path.
if rule_elt.train.learn_from_controller == nil then
rule_elt.train.learn_from_controller = rule_elt.disable_symbols_input and true or false
end
if not rule_elt.profile then
rule_elt.profile = {}
end

3
test/functional/configs/neural_learn_task.conf

@ -53,6 +53,9 @@ neural {
max_trains = 1;
max_iterations = 250;
classes_bias = 0.0;
# opt into controller learning (off by default to preserve the
# historical split-learning behaviour).
learn_from_controller = true;
}
symbol_spam = "NEURAL_SPAM_SHORT";
symbol_ham = "NEURAL_HAM_SHORT";

Loading…
Cancel
Save