From 8ff4eb80769e071a02c3ba08f730035c44857591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Fri, 18 May 2018 21:39:25 +0200 Subject: [PATCH] [Rspamd] Slight changes to neural plugin --- data/conf/rspamd/local.d/neural.conf | 40 +++++++--------------- data/conf/rspamd/local.d/neural_group.conf | 18 +++------- 2 files changed, 18 insertions(+), 40 deletions(-) diff --git a/data/conf/rspamd/local.d/neural.conf b/data/conf/rspamd/local.d/neural.conf index 7f3a77d4..7b62f269 100644 --- a/data/conf/rspamd/local.d/neural.conf +++ b/data/conf/rspamd/local.d/neural.conf @@ -1,28 +1,14 @@ -rules { - "LONG" { - train { - max_trains = 800; - max_usages = 40; - max_iterations = 25; - learning_rate = 0.01, - spam_score = 9; - ham_score = -4; - } - symbol_spam = "NEURAL_SPAM_LONG"; - symbol_ham = "NEURAL_HAM_LONG"; - ann_expire = 31d; - } - "SHORT" { - train { - max_trains = 90; - max_usages = 20; - max_iterations = 15; - learning_rate = 0.01, - spam_score = 9; - ham_score = -4; - } - symbol_spam = "NEURAL_SPAM_SHORT"; - symbol_ham = "NEURAL_HAM_SHORT"; - ann_expire = 7d; - } +servers = "31.47.234.2:6379"; +train { + max_train = 1k; # Number of trains per epoch + max_usages = 50; # Number of learn iterations while ANN data is valid + spam_score = 12; # Score to learn spam + ham_score = -7; # Score to learn ham + learning_rate = 0.01; # Rate of learning (Torch only) + max_iterations = 25; # Maximum iterations of learning (Torch only) } +ann_expire = 80d; +timeout = 20; # Increase redis timeout +enabled = ${HAS_TORCH}; # Explicitly disable module when torch is disabled +use_settings = false; # If enabled, then settings-id is used to dispatch networks + diff --git a/data/conf/rspamd/local.d/neural_group.conf b/data/conf/rspamd/local.d/neural_group.conf index 6ebf6bbd..8d43d715 100644 --- a/data/conf/rspamd/local.d/neural_group.conf +++ b/data/conf/rspamd/local.d/neural_group.conf @@ -1,18 +1,10 @@ symbols = { - "NEURAL_SPAM_LONG" { - weight = 4.2; # sample weight - description = "Neural network spam (long)"; + "NEURAL_SPAM" { + weight = 4.0; # sample weight + description = "Neural network spam"; } - "NEURAL_HAM_LONG" { + "NEURAL_HAM" { weight = -4.0; # sample weight - description = "Neural network ham (long)"; - } - "NEURAL_SPAM_SHORT" { - weight = 3.0; # sample weight - description = "Neural network spam (short)"; - } - "NEURAL_HAM_SHORT" { - weight = -2.0; # sample weight - description = "Neural network ham (short)"; + description = "Neural network ham"; } }