diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-28 08:26:05 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-28 08:26:05 +0100 |
commit | 27895da18643c7ccabc48e6eac2587a1f919038c (patch) | |
tree | 1bb779744843b2b06d46bed23fbf998ce173f119 | |
parent | d59bcf73d33b0029b617aa1b37ac9ea761948e46 (diff) | |
download | rspamd-27895da18643c7ccabc48e6eac2587a1f919038c.tar.gz rspamd-27895da18643c7ccabc48e6eac2587a1f919038c.zip |
[Minor] Filter NaNs from ANN training vectors
-rw-r--r-- | src/plugins/lua/fann_scores.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/lua/fann_scores.lua b/src/plugins/lua/fann_scores.lua index 4737c7ba0..e6c7eade4 100644 --- a/src/plugins/lua/fann_scores.lua +++ b/src/plugins/lua/fann_scores.lua @@ -50,6 +50,7 @@ local function symbols_to_fann_vector(syms, scores) local n = rspamd_config:get_symbols_count() fun.each(function(s, score) + if score ~= score then score = 0.0 end -- nan sanity matched_symbols[s + 1] = rspamd_util.tanh(score) end, fun.zip(syms, scores)) |