Skip to content

Commit

Permalink
Started linting
Browse files Browse the repository at this point in the history
  • Loading branch information
reverendbedford committed Jan 12, 2024
1 parent ea9f582 commit c50b0ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyoptmat/chunktime.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ def newton_raphson_chunk(
while (i < miter) and torch.any(
torch.logical_not(torch.logical_or(nR <= atol, nR / nR0 <= rtol))
):
print(i, torch.max(nR))
dx = solver.solve(J, R)
if linesearch:
x, R, J, nR, alpha = chunk_linesearch(x, dx, fn, R, rtol, atol)
x, R, J, nR = chunk_linesearch(x, dx, fn, R, rtol, atol)
else:
x -= dx
R, J = fn(x)
Expand All @@ -82,7 +81,8 @@ def chunk_linesearch(
"""
Backtracking linesearch for the chunk NR algorithm.
Terminates when the Armijo criteria is reached, or you exceed some maximum iterations, or when you would meet the
Terminates when the Armijo criteria is reached, or you exceed
some maximum iterations, or when you would meet the
convergence requirements with the current alpha
Args:
Expand Down Expand Up @@ -114,7 +114,7 @@ def chunk_linesearch(
break
alpha[nR >= crit] /= sigma

return x - dx * alpha.unsqueeze(-1), R, J, torch.norm(R, dim=-1), alpha
return x - dx * alpha.unsqueeze(-1), R, J, torch.norm(R, dim=-1)


class BidiagonalOperator(torch.nn.Module):
Expand Down

0 comments on commit c50b0ec

Please sign in to comment.