[Rspamd-Users] Neural Question

christian usenet at schani.com
Mon Jul 15 12:43:07 UTC 2024


Am 14.07.2024 um 12:52 schrieb Vsevolod Stakhov:
> On 13/07/2024 19:24, christian via Users wrote:
>> Hello,
>> after the neural "max_trains = 100" has been trained, a process 
>> "rspam: lua process: ANN train for SHORT/default" starts and uses a 
>> CPU core to 100% permanently.
>>
>>
>> New emails are learned until 100 entries are stored:
>>
>> 2024-07-13 18:41:32 #729426(controller) <duy5w5>; neural; 
>> neural.lua:707: cannot learn ANN rn_SHORT_default_bioioq5b_0 now: 
>> there are not enough ham learn vectors (has {[spam] = 39, [ham] = 34} 
>> vectors; 100 required)
>> 2024-07-13 18:41:32 #729426(controller) <duy5w5>; neural; 
>> neural.lua:707: cannot learn ANN rn_LONG_default_bioioq5b_0 now: there 
>> are not enough ham learn vectors (has {[spam] = 351, [ham] = 297} 
>> vectors; 1000 required)
>>
>>
>> After this process has been started, no more SHORT:default entries 
>> appear in the log. No emails are tagged either. It seems as if the 
>> neural function freezes after reaching the 100 limit. It is the same 
>> with the LONG with a value of 100. After reaching this limit, a 
>> process starts which then constantly uses the CPU to its full capacity.
>>
> 
> Yes, that's exactly how NN learning works - it is CPU expensive task.


Vsevolod, I understand.
But why does rspamd neural learn emails until it reaches a value of 100, 
then starts the process and aborts after a few minutes and then starts 
again from the beginning.
Here is an example from the log:

2024-07-14 14:39:40 #827828(controller) <en34z8>; neural; 
neural.lua:707: cannot learn ANN rn_SHORT_default_bioioq5b_2 now: there 
are not enough ham learn vectors (has {[spam] = 99, [ham] = 89} vectors; 
100 required)
2024-07-14 14:40:40 #827828(controller) <en34z8>; neural; 
neural.lua:707: cannot learn ANN rn_SHORT_default_bioioq5b_2 now: there 
are not enough ham learn vectors (has {[spam] = 99, [ham] = 89} vectors; 
100 required)
2024-07-14 14:41:40 #827828(controller) <en34z8>; neural; 
neural.lua:707: cannot learn ANN rn_SHORT_default_bioioq5b_2 now: there 
are not enough ham learn vectors (has {[spam] = 99, [ham] = 89} vectors; 
100 required)
2024-07-14 14:42:40 #827828(controller) <en34z8>; neural; 
neural.lua:707: cannot learn ANN rn_SHORT_default_bioioq5b_2 now: there 
are not enough ham learn vectors (has {[spam] = 99, [ham] = 89} vectors; 
100 required)

### Process starting und Freeze/Stall 10 minutes ###

2024-07-14 14:52:43 #827828(controller) <en34z8>; neural; 
neural.lua:707: cannot learn ANN rn_SHORT_default_bioioq5b_3 now: there 
are not enough ham learn vectors (has {[spam] = 0, [ham] = 0} vectors; 
100 required)
2024-07-14 14:53:40 #827828(controller) <en34z8>; neural; 
neural.lua:707: cannot learn ANN rn_SHORT_default_bioioq5b_3 now: there 
are not enough ham learn vectors (has {[spam] = 1, [ham] = 0} vectors; 
100 required)
2024-07-14 14:54:40 #827828(controller) <en34z8>; neural; 
neural.lua:707: cannot learn ANN rn_SHORT_default_bioioq5b_3 now: there 
are not enough ham learn vectors (has {[spam] = 1, [ham] = 3} vectors; 
100 required)
2024-07-14 14:55:40 #827828(controller) <en34z8>; neural; 
neural.lua:707: cannot learn ANN rn_SHORT_default_bioioq5b_3 now: there 
are not enough ham learn vectors (has {[spam] = 3, [ham] = 3} vectors; 
100 required)
2024-07-14 14:56:40 #827828(controller) <en34z8>; neural; 
neural.lua:707: cannot learn ANN rn_SHORT_default_bioioq5b_3 now: there 
are not enough ham learn vectors (has {[spam] = 3, [ham] = 3} vectors; 
100 required)
2024-07-14 14:57:40 #827828(controller) <en34z8>; neural; 
neural.lua:707: cannot learn ANN rn_SHORT_default_bioioq5b_3 now: there 
are not enough ham learn vectors (has {[spam] = 3, [ham] = 3} vectors; 
100 required)



This happens over and over again. As soon as max_trains is reached, it 
starts again from the beginning.
I have already searched the log file thoroughly for error messages, but 
cannot find any HG reference. There is nothing in the redis log either.
I only used the standard neural.conf file:

neural.conf
servers = 127.0.0.1:6379;
enabled = true;
timeout = 120; # Increase redis timeout
	
rules {
   "LONG" {
     train {
       max_trains = 1000;
       max_usages = 200;
       max_iterations = 25;
       learning_rate = 0.01,
     }
     symbol_spam = "NEURAL_SPAM_LONG";
     symbol_ham = "NEURAL_HAM_LONG";
     ann_expire = 30d;
   }
   "SHORT" {
     train {
       max_trains = 100;
       max_usages = 20;
       max_iterations = 25;
       learning_rate = 0.01,
     }
     symbol_spam = "NEURAL_SPAM_SHORT";
     symbol_ham = "NEURAL_HAM_SHORT";
     ann_expire = 2d;
   }
}


Christian


More information about the Users mailing list