Project DelphiTensors Workshop

Non-negativity keeps the subproblem convex

The unconstrained ALS factors have negative numbers in all three. A firing rate cannot be negative, so a component with a negative entry still reconstructs the data but is no longer a profile you can read.

Add the constraint and, with B and C fixed, the update becomes non-negative least squares (NNLS): still convex, one row of A at a time, solved exactly by scipy.optimize.nnls. What is lost is the closed form — no pseudoinverse respects an inequality. The alternating structure is untouched.

In practice tensorly offers multiplicative updates and HALS, hierarchical alternating least squares, which updates one column at a time and converges faster. Expect the constrained fit to be slightly worse in squared error — it searches a subset of the space — and to buy factors you can describe in words.