Skip to content

Commit

Permalink
deactivated QR, switched to lsmr
Browse files Browse the repository at this point in the history
  • Loading branch information
enzbus committed Sep 10, 2024
1 parent 9b9eab9 commit 7168e08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion project_euromir/direction_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions project_euromir/solver_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 7168e08

Please sign in to comment.