Skip to content

Commit

Permalink
Add comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
mblondel committed Nov 1, 2019
1 parent 7fb33e5 commit bec7be2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions polytopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,9 @@ def _Euclidean_project(self, theta):
theta = theta[perm]
dual_sol = isotonic_regression(w - theta, increasing=True)
primal_sol = dual_sol + theta
# Or equivalently
#dual_sol = isotonic_regression(theta - w, increasing=False)
#primal_sol = theta - dual_sol
return primal_sol[inv_permutation(perm)]

def _KL_project(self, theta):
Expand Down

0 comments on commit bec7be2

Please sign in to comment.