From b0e65124da0330713cd72c42254c153974b710eb Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 26 Jul 2019 07:47:53 +0200 Subject: add parameter normalization support to YAML DFA models --- lib/functions.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/functions.py') diff --git a/lib/functions.py b/lib/functions.py index ebeb2a2..c30a5f7 100644 --- a/lib/functions.py +++ b/lib/functions.py @@ -87,6 +87,18 @@ class ParamFunction: """ return self._param_function(P, X) - y +class NormalizationFunction: + """ + Hi + """ + + def __init__(self, function_str): + self._function_str = function_str + self._function = eval('lambda param: ' + function_str) + + def eval(self, param_value): + return self._function(param_value) + class AnalyticFunction: """ A multi-dimensional model function, generated from a string, which can be optimized using regression. -- cgit v1.2.3