1

I wrote a 2D fused lasso code here.

[m n] = size(circle);
cvx_begin
    variable theta(m, n);
    minimize( norm(circle-theta, 'fro'));
    subject to
        sum(sum(abs(theta(:,1:n-1)-theta(:,2:n)))) == 0;
        sum(sum(abs(theta(1:m-1,:)-theta(2:m,:)))) == 0;
cvx_end

Weirdly, the program report,

In cvxprob (line 28) In cvx_begin (line 41) Error using cvxprob/newcnstr (line 192) Disciplined convex programming error:
Invalid constraint: {convex} == {constant}

Error in == (line 12) b = newcnstr( evalin( 'caller', 'cvx_problem', '[]' ), x, y, '==' );

After I remove abs() in the constraint, the program could run, but that's not what constraints I expect to be.

xxx222
  • 2,980
  • 5
  • 34
  • 53

1 Answers1

0

I think you can try stacking the matrices into vectors, then use L1 norm. In CVX, it's just norm(variable, 1). It will do the same as you wrote here: sum of absolute elementary-wise differences.