Skip to content

Commit

Permalink
Merge pull request #111 from tomMoral/FIX_adapt_numpy2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arokem authored Jul 3, 2024
2 parents 5423537 + cfb16a7 commit c0d5d46
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion copt/constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __call__(self, x):
if np.abs(x).sum() <= self.alpha:
return 0
else:
return np.infty
return np.inf

def prox(self, x, step_size=None):
"""Projection onto the L-infinity ball.
Expand Down
2 changes: 1 addition & 1 deletion copt/proximal_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _prox(x, _):
prox = _prox

success = False
certificate = np.NaN
certificate = np.nan

func_and_grad = utils.build_func_grad(jac, fun, args, eps)

Expand Down
2 changes: 1 addition & 1 deletion copt/splitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def prox_2_conj(x, ss):
ss_ratio = tau / sigma

fk, grad_fk = f_grad(x)
norm_incr = np.infty
norm_incr = np.inf
x_next = x.copy()

for it in range(max_iter):
Expand Down
2 changes: 1 addition & 1 deletion copt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def wrapper(*args, **kwargs):
def build_func_grad(jac, fun, args, eps):
if not callable(jac):
if bool(jac):
fun = optimize.optimize.MemoizeJac(fun)
fun = optimize._optimize.MemoizeJac(fun)
jac = fun.derivative
elif jac == "2-point":
jac = None
Expand Down

0 comments on commit c0d5d46

Please sign in to comment.