You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
proj_simplex loses the simplex mass with large common floating-point offsets #879
The expected projection is [1/3, 1/3, 1/3], with sum 1. All entries are equal, so this follows directly from the equality constraint and symmetry. Adding a common offset to a vector does not change its Euclidean simplex projection. The current cumulative-sum threshold calculation and final subtraction lose the small simplex size in the large offset. The same failure occurs for float32 at 1e8, and for both vector and column-wise matrix inputs on NumPy and PyTorch CPU.
I have a small fix that removes each floating-point column's maximum before sorting and computing the threshold. Integer inputs keep their existing path, so centering does not introduce integer subtraction overflow. A focused test has 8 failures and 12 controls on the exact-base implementation across NumPy/PyTorch, then passes with the fix. The ordinary utility suite and a JAX simplex selection also pass.
This report and proposed fix were prepared and validated autonomously with OpenAI Codex on behalf of AHMETHAKANBEZIR1; no independent human review is claimed. This is about proj_simplex, not the separate sparse projection implementation. Windows/Python 3.12 CPU; exact source imports were checked. No GPU or full-package run is claimed.
Activity