Functor for the SP projector.
A, the image matrix, is such that \( \| A \|_0 = k, \| A\|_F = 1 \) (if normalized == True).
>>> from numpy.random import rand, seed
>>> import numpy as np
>>> M = np.round(
rand(5,5), decimals=2)
>>> M
array([[0.37, 0.95, 0.73, 0.6 , 0.16],
[0.16, 0.06, 0.87, 0.6 , 0.71],
[0.02, 0.97, 0.83, 0.21, 0.18],
[0.18, 0.3 , 0.52, 0.43, 0.29],
[0.61, 0.14, 0.29, 0.37, 0.46]])
>>> p = sp(M.shape, 3, normalized=False)
>>> p(M)
array([[0. , 0.95, 0. , 0. , 0. ],
[0. , 0. , 0.87, 0. , 0. ],
[0. , 0.97, 0. , 0. , 0. ],
[0. , 0. , 0. , 0. , 0. ],
[0. , 0. , 0. , 0. , 0. ]])