From 54cb9c0f47b17c57e30c9b8e2b0feb9f11623a09 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Thu, 12 Dec 2024 18:21:08 +0100 Subject: Support lower regression bounds other than -∞ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DFATOOL_ULS_MIN_BOUND=0 is especially useful in many cases --- lib/paramfit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/paramfit.py') diff --git a/lib/paramfit.py b/lib/paramfit.py index 05ffb86..000aa9c 100644 --- a/lib/paramfit.py +++ b/lib/paramfit.py @@ -17,6 +17,7 @@ from .utils import ( logger = logging.getLogger(__name__) best_fit_metric = os.getenv("DFATOOL_ULS_ERROR_METRIC", "ssr") +dfatool_uls_min_bound = float(os.getenv("DFATOOL_ULS_MIN_BOUND", -np.inf)) class ParamFit: @@ -211,7 +212,7 @@ def _try_fits( ini = [0] + [1 for i in range(1, param_function._num_variables)] if function_name == "roofline": param_function.bounds = ( - (-np.inf, -np.inf, np.min(X)), + (dfatool_uls_min_bound, dfatool_uls_min_bound, np.min(X)), (np.inf, np.inf, np.max(X)), ) ini[2] = np.mean(X) -- cgit v1.2.3