Skip to content

Instantly share code, notes, and snippets.

@feiaa
feiaa / projection_simplex.py
Created June 11, 2018 13:03 — forked from mblondel/projection_simplex.py
Projection onto the simplex
"""
Implements three algorithms for projecting a vector onto the simplex: sort, pivot and bisection.
For details and references, see the following paper:
Large-scale Multiclass Support Vector Machine Training via Euclidean Projection onto the Simplex
Mathieu Blondel, Akinori Fujino, and Naonori Ueda.
ICPR 2014.
http://www.mblondel.org/publications/mblondel-icpr2014.pdf