From 7168e08a1b34af386c3ea9c74a9b555dcd5d1c99 Mon Sep 17 00:00:00 2001 From: Enzo Busseti Date: Tue, 10 Sep 2024 16:42:16 +0800 Subject: [PATCH] deactivated QR, switched to lsmr --- project_euromir/direction_calculator.py | 2 +- project_euromir/solver_new.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/project_euromir/direction_calculator.py b/project_euromir/direction_calculator.py index f747a37..3786329 100644 --- a/project_euromir/direction_calculator.py +++ b/project_euromir/direction_calculator.py @@ -370,7 +370,7 @@ class LSMRLevenbergMarquardt(LSQRLevenbergMarquardt): def _inner_function(self, derivative_residual, residual, current_gradient): """Just the call to the iterative solver.""" - breakpoint() + # breakpoint() result = sp.sparse.linalg.lsmr( derivative_residual, -residual, x0=self._x0, damp=1e-06, # seems # that up to about 1e-6 performance is not affected diff --git a/project_euromir/solver_new.py b/project_euromir/solver_new.py index 99da038..cc9858d 100644 --- a/project_euromir/solver_new.py +++ b/project_euromir/solver_new.py @@ -41,7 +41,7 @@ logger = logging.getLogger(__name__) -QR_PRESOLVE = True +QR_PRESOLVE = False def solve(matrix, b, c, zero, nonneg, # xy = None, # need to import logic for equilibration @@ -181,11 +181,11 @@ def _local_derivative_residual(xy): # ) # LSMR seems better than LSQR and CG, however need to count matrix evals - # direction_calculator = LSMRLevenbergMarquardt( - # residual_function=_local_residual, - # derivative_residual_function=_local_derivative_residual, - # # warm_start=True, # also doesn't work with warm start - # ) + direction_calculator = LSMRLevenbergMarquardt( + residual_function=_local_residual, + derivative_residual_function=_local_derivative_residual, + # warm_start=True, # also doesn't work with warm start + ) # direction_calculator = DenseNewton( #WarmStartedCGNewton( # hessian_function=_local_hessian,