I am trying to implement the Sum Of Norms clustering method (
here is an example in cvx for MATLAB), but I am having an issue with calculating the p-norm along a single dimension of a matrix. When using cvxpy.pnorm() on a matrix, a scalar value is returned. Is there a way to tell cvxpy to only take the pnorm along a certain dimension like the norms function in cvx for MATLAB?
Currently, I am using cvxpy.vstack to generate a vector of p-norms with the following code:
a = cvx.vstack(0)
for i in xrange(numColJ):
a = cvx.vstack(a,cvx.pnorm(J*X[i,:],p=p))
This method works for a small data set, but I get "RuntimeError: maximum recursion depth exceeded in cmp" when I try this on a larger data set.
Thanks