local rspamd_kann = require "rspamd_kann"
local lua_redis = require "lua_redis"
local lua_util = require "lua_util"
+local rspamd_tensor = require "rspamd_tensor"
local fun = require "fun"
local lua_settings = require "lua_settings"
local meta_functions = require "lua_meta"
hidden_layer_mult = 1.5, -- number of neurons in the hidden layer
symbol_spam = 'NEURAL_SPAM',
symbol_ham = 'NEURAL_HAM',
+ max_inputs = nil, -- when PCA is used
}
local redis_profile_schema = ts.shape{
distance = ts.number:is_optional(),
}
+local has_blas = rspamd_tensor.has_blas()
+
-- Rule structure:
-- * static config fields (see `default_options`)
-- * prefix - name or defined prefix
if not rule_elt.profile then rule_elt.profile = {} end
+ if rule_elt.max_inputs and not has_blas then
+ rspamd_logger.errx('cannot set max inputs to %s as BLAS is not compiled in',
+ rule_elt.name, rule_elt.max_inputs)
+ rule_elt.max_inputs = nil
+ end
+
rspamd_logger.infox(rspamd_config, "register ann rule %s", k)
settings.rules[k] = rule_elt
rspamd_config:set_metric_symbol({