Demo of the synthetic experiments.
Contents
Requires UGM at http://www.di.ens.fr/~mschmidt/Software/UGM_2009.zip
Requires TFOCS at http://tfocs.stanford.edu
Graph parameters
p=10;
q=10;
n=2000;
e=ones(n,1);
L=2*ones(q,1);
Ltot=sum(L);
Create params
rhocts=.25;
thcts=eye(p);
for i=1:p-1
thcts(i,i+1)=rhocts;
thcts(i+1,i)=rhocts;
end
thdiscts=cell(p,q);
maskDisCts=sparse(p,q);
for i=1:min(p,q)
rhocd=.5;
maskDisCts(i,i)=1;
thdiscts{i,i}=[rhocd; -rhocd];
end
thdis=cell(q,q);
maskDis = sparse(diag(ones(q-1,1),1));
[R J]=find(maskDis);
for e=1:length(R)
thdis{R(e),J(e)}=.5*[1 -1; -1 1];
end
sample
mixSample;
Init opt variables
theta=zeros(Ltot,p);
beta=zeros(p,p);
betad=ones(p,1);
alpha1=zeros(p,1);
alpha2=zeros(Ltot,1);
phi=zeros(Ltot,Ltot);
Lsum=[0;cumsum(L)];
x=paramToVecv5(beta,betad,theta,phi,alpha1,alpha2,L,n,p,q);
call TFOCS
lam=5*sqrt(log(p+q)/n);
smoothF= @(x)lhoodTfocsv5(x,D,X,Y,L,n,p,q);
nonsmoothH=@(varargin) tfocsProxGroupv6(lam,L,n,p,q, varargin{:} );
opts.alg='N83'; opts.maxIts=800; opts.printEvery=100; opts.saveHist=true;
opts.restart=-10^4;
opts.tol=1e-10;
[xopt out opts]=tfocs(smoothF, {}, nonsmoothH, x,opts);
[beta betad theta phi alpha1 alpha2]= vecToParamv5(xopt,L,n,p,q);
Nesterov's 1983 single-projection method
Iter Objective |dx|/|x| step
----+----------------------------------
89 | +1.20234e+001 3.08e-013 2.83e-005*
Finished: Step size tolerance reached
Plot parameters
close all;
figure(1); imagesc(triu(thcts-diag(diag(thcts)))); title('cts truth'); colorbar;
figure(2); imagesc(-beta); title('cts recover'); colorbar;
figure(3); imagesc(maskDis); title('discrete truth');colorbar;
figure; imagesc(phi); title('dis recover');colorbar;
figure; imagesc(maskDisCts); title('cts-dis truth');colorbar;
figure; imagesc(theta'); title('cts-dis recover');colorbar;