Skip to content

Commit

Permalink
fix type J must be J_a
Browse files Browse the repository at this point in the history
  • Loading branch information
YigitElma committed Aug 15, 2024
1 parent 5e30fdc commit dc1c6aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions desc/optimize/aug_lagrangian_ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,12 @@ def lagjac(z, y, mu, *args):
B_h = jnp.dot(J_a.T, J_a)
elif tr_method == "qr":
# try full newton step
tall = J.shape[0] >= J.shape[1]
tall = J_a.shape[0] >= J_a.shape[1]
if tall:
Q, R = qr(J, mode="economic")
Q, R = qr(J_a, mode="economic")
p_newton = solve_triangular_regularized(R, -Q.T @ f)
else:
Q, R = qr(J.T, mode="economic")
Q, R = qr(J_a.T, mode="economic")
p_newton = Q @ solve_triangular_regularized(R.T, -f, lower=True)

actual_reduction = -1
Expand Down
6 changes: 3 additions & 3 deletions desc/optimize/least_squares.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ def lsqtr( # noqa: C901 - FIXME: simplify this
B_h = jnp.dot(J_a.T, J_a)
elif tr_method == "qr":
# try full newton step
tall = J.shape[0] >= J.shape[1]
tall = J_a.shape[0] >= J_a.shape[1]
if tall:
Q, R = qr(J, mode="economic")
Q, R = qr(J_a, mode="economic")
p_newton = solve_triangular_regularized(R, -Q.T @ f)
else:
Q, R = qr(J.T, mode="economic")
Q, R = qr(J_a.T, mode="economic")
p_newton = Q @ solve_triangular_regularized(R.T, -f, lower=True)

actual_reduction = -1
Expand Down

0 comments on commit dc1c6aa

Please sign in to comment.