Cryptic error messages due to solver failure


I am trying to solve the following optimzation problem in cvx (image because I don’t know how to type that in mathtype)

image description

and I am having some trouble with it. I am getting not very descriptive errors. My code is the following:

cvx_begin quiet
disp('searching for 2-norm soft margin kernel matrix weights and param - eqn 45');
% optimization variables 
% TODO - can we make this dynamic?
variables u1 u2 u3 u4 u5 u6
variable t
variable lambda
variable v(train_size)
variable tau
% objective function
minimize( t );
% constraints
subject to
    K_prime = u1*kernel_guesses{1} + u2*kernel_guesses{2} + u3*kernel_guesses{3} + ... 
              u4*kernel_guesses{4} + u5*kernel_guesses{5} + u6*kernel_guesses{6};
    trace(K_prime + tau*eye(train_size+test_size)) == trace_val;
    K_prime == semidefinite(train_size+test_size);
    v >= 0;
    tau >= 0;
    % LMI
    K_tr_prime = 
u1*kernel_guesses{1}(1:train_size, 1:train_size) + ...
u2*kernel_guesses{2}(1:train_size, 1:train_size) + ...
u3*kernel_guesses{3}(1:train_size, 1:train_size) + ...
u4*kernel_guesses{4}(1:train_size, 1:train_size) + ...
u5*kernel_guesses{5}(1:train_size, 1:train_size) + ...
u6*kernel_guesses{6}(1:train_size, 1:train_size);
 (gram(K_tr_prime, train_labels) + tau*eye(train_size))        
 (ones(train_size,1) + v + lambda*train_labels);
 (ones(train_size,1) + v + lambda*train_labels)'
] == semidefinite(train_size+1);

And my errors are the following:

Error using eig
Input to EIG must not contain NaN or Inf.

Error in maxstep (line 64)
    mindxs = min(psdeig(reldx, K));

Error in wregion (line 99)
        maxt1 = min(maxstep(dx,xc,uxc,K),

Error in sedumi (line 444)
    [xscl,yNxt,zscl,y0Nxt, w,relt,
    dxmdz,err, wr] = ...

Error in cvx_solve_sedumi (line 99)
[ xx, yy, info ] = sedumi( At, b, c, K, pars

Error in cvxprob/solve (line 383)
        [ x, y, status, tprec, iters ] =
        feval( sfunc, At, b, c, cones,
        quiet, prec );

Error in cvx_end (line 77)
    solve( prob );

Error in main_aud_cvx>classify (line 274)

Which I can’t really do much with. What exactly am I doing wrong? Is it how I’m using the u1-u6 variables?

This looks like a solver problem, actually. Try SDPT3 and see what happens. It also appears as if you are using an older version of CVX, but I don’t think that’s an issue—though the error message would have been a bit more clear in the newer version.

I also opened a bug report for this question to address the non informative error message and in the result ended up upgrading to v2.0 and my problem was solved.


Thanks, by any chance do you know if its possible to dynamically create u1-u6 and use them inside cvx?

I’m glad we could work it out! I’m going to change the title of this thread so that it is a bit more directly related to the problem you encountered.