Skip to content

Commit

Permalink
Limit max and min eigenvalues during optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
aseyboldt committed Jun 7, 2022
1 parent 2a8ca6b commit c6ad5c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion covadapt/spd_manifold.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ def cost(*args):
else:
loss = 2 * loss_x

return loss + reg_diag + reg_vals + reg_vecs
loss = loss + reg_diag + reg_vals + reg_vecs
return torch.where(((log_vals < -30) | (log_vals > 30)).any(), np.inf, loss)

return pymanopt.Problem(manifold, cost)

Expand Down

0 comments on commit c6ad5c5

Please sign in to comment.