Skip to content

Commit

Permalink
Forgotten couple of lines
Browse files Browse the repository at this point in the history
  • Loading branch information
lmalina committed Jan 5, 2024
1 parent 464649e commit 516911a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pySC/correction/loco.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def loco_correction_lm(initial_guess0, orm_model, orm_measured, Jn, lengths, inc
def loco_correction_ng(initial_guess0, orm_model, orm_measured, J, Jt, lengths, including_fit_parameters, weights=1,
max_iterations=1000, eps=1e-6):
initial_guess = initial_guess0.copy()
for iter in range(max_iterations):
for _ in range(max_iterations):
residuals = objective(initial_guess, orm_model, orm_measured, J, lengths, including_fit_parameters, 1)
r = residuals.reshape(orm_model.shape)

Expand All @@ -91,10 +91,8 @@ def loco_correction_ng(initial_guess0, orm_model, orm_measured, J, Jt, lengths,

t3 = (np.dot(Jt, t2)).reshape(-1)
initial_guess1 = initial_guess + t3
t4 = np.abs(initial_guess1 - initial_guess)

if max(t4) <= eps:
break
if np.max(np.abs(t3)) <= eps:
return initial_guess
initial_guess = initial_guess1
return initial_guess

Expand Down

0 comments on commit 516911a

Please sign in to comment.