Skip to content

Commit

Permalink
FIX: test FW
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianp committed Oct 2, 2018
1 parent e987f4c commit 460ad89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions copt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def __call__(self, x):
def init_lipschitz(f_grad, x0):
L0 = 1e-3
f0, grad0 = f_grad(x0)
if sparse.issparse(grad0):
x0 = sparse.csc_matrix(x0).T
elif sparse.issparse(x0):
grad0 = sparse.csc_matrix(grad0).T
x_tilde = x0 - (1./L0)*grad0
f_tilde = f_grad(x_tilde)[0]
while f_tilde > f0:
Expand Down

0 comments on commit 460ad89

Please sign in to comment.