source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/dev/regress_srebo.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 754 bytes
Line 
1randn('state',8342182);
2n = 5;
3m = 10;
4
5S = randn(n,m)>0;
6y = sign(randn(n,m)).*S;
7
8% 1) Standard primal model, very inefficient
9yalmip('clear')
10X = sdpvar(n,m);
11F = set(X(S).*y(S)>1);
12obj = tracenorm(X);
13solvesdp(F,obj);
14X1 = double(X);
15
16% 2) Try to dualize, will be better, but still not optimal
17[Fd,objd] = dualize(F,obj);
18assign(X,0*double(X))
19solvesdp(Fd,-objd)
20X2 = double(X);
21
22% 3) Reduce problem after dualization (correspponds to imagemodel)
23assign(X,0*double(X))
24solvesdp(Fd,-objd,sdpsettings('remove',2));
25X3 = double(X);
26
27% 4) Manual
28[i,a] = find(S);
29q = sdpvar(1,length(i));
30Q = sparse(i,a,q,n,m);
31spQ = set([eye(n) (Q.*y);(Q.*y)' eye(m)]>=0);
32solvesdp(spQ + set(Q>=0),-sum(Q(S)));
33optAXXB = dual(spQ);
34X4 = -optAXXB(1:n,(n+1):end)*2;
35
36
37
38
Note: See TracBrowser for help on using the repository browser.