Skip to content

Add a projection to the probability simplex, and a test for it.#15

Open
daniel-vainsencher wants to merge 19 commits intoBRML:masterfrom
daniel-vainsencher:master
Open

Add a projection to the probability simplex, and a test for it.#15
daniel-vainsencher wants to merge 19 commits intoBRML:masterfrom
daniel-vainsencher:master

Conversation

@daniel-vainsencher
Copy link

Useful for implementing gradient projection type algorithms on the probability simplex.

@bayerj
Copy link
Contributor

bayerj commented Dec 11, 2013

Some things:

  • numpy doc usage
  • some pep8 violations (e.g. 79 char line limit, https://pypi.python.org/pypi/pep8 is a good tool)
  • reference
  • can you find more descriptive names for f, v and a?
  • use (np | gp).(sum | min) instead of builtin (please do not shadow the builtin)

Apart from that, I am fine with the PR.

@daniel-vainsencher
Copy link
Author

Hi, I think its ready for inclusion now. I'm not so sure about variable names in this context (numerical computation); the mathy one letter names have their own readability benefits. In this case I gave meaningful names where I found them, let me know what you think.

@bayerj
Copy link
Contributor

bayerj commented Feb 24, 2014

Hey Daniel,

Sorry for not getting back to this earlier. One more point: do you have a reference for the method employed?

Best,
-Justin

@daniel-vainsencher
Copy link
Author

body p { margin-bottom: 5px; margin-top: 0pt; }
No problem.
No, I would call this folklore. There are two aspects: solving
projection to simplex as search in one dimension, which is well
known (say, a HW solution on boyds optimization course comes up if
you google it), and using Newton's method for it which is only
slightly better and slightly more obscure than using binary
search. It is certainly not the state of the art anyway, just
simple to code.
Daniel
On 02/24/2014 11:14 AM, Justin Bayer wrote:

  Hey Daniel,
  Sorry for not getting back to this earlier. One more point: do
    you have a reference for the method employed?
  Best,
    -Justin
  —
    Reply to this email directly or view
      it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants