Skip to content

Commit

Permalink
Minor modifications to admm
Browse files Browse the repository at this point in the history
  • Loading branch information
mnarayan committed Mar 1, 2017
1 parent 26c3dab commit d90be24
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
14 changes: 7 additions & 7 deletions @admm/admm.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

methods(Static)

output = admm_solver(Sigma,varargin);
output = admm_solver(Sigma,varargin);

options = admm_options(varargin);
options = admm_options(varargin);

options = initializeXZU(Sigma,varargin);
options = initializeXZU(Sigma,varargin);

output = objective(Sigma,Theta,Z,Lambda);
output = objective(Sigma,Theta,Z,Lambda);

[X,Z] = update_X(Sigma,X,Z,U,options);
[X,Z] = update_X(Sigma,X,Z,U,options);

[Z_new,X_new] = update_Z(X,Z,U,options);
[Z_new,X_new] = update_Z(X,Z,U,options);

U = update_U(X,Z,U);
U = update_U(X,Z,U);

end

Expand Down
29 changes: 18 additions & 11 deletions test/test_GGM.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function test_suite = test_GGM
initTestSuite;
buildFunctionHandleTestSuite(localfunctions);

end

Expand Down Expand Up @@ -33,16 +33,18 @@
clear GGMobj;
GGMobj = GGM(Data,1,0);
GGMobj.sparseMLE();


if(GGMobj.verbose)
gr_sparsity = squeeze(sum(sum(GGMobj.ThetaPath~=0,1),2))';
gr_sparsity(1:10)
gr_sparsity = squeeze(sum(sum(GGMobj.AdaptTheta~=0,1),2))';
gr_sparsity(1:10)
end

% Check plotting of regularization path
GGMobj.plot();
% UNTESTED
% if(GGMobj.verbose)
% gr_sparsity = squeeze(sum(sum(GGMobj.ThetaPath~=0,1),2))';
% n_lambdas = min(25,floor(.25*numel(gr_sparsity)));
% gr_sparsity(1:n_lambdas)
% gr_sparsity = squeeze(sum(sum(GGMobj.AdaptTheta~=0,1),2))';
% gr_sparsity(1:n_lambdas)
% end
% % Check plotting of regularization path
% GGMobj.plot();

% Check Model Selection
currstate = rng;
Expand All @@ -56,7 +58,12 @@
% Check tylerMLE
GGMobj = GGM(Data);
[GGMobj results] = GGMobj.tylerMLE();


% Check debias
GGMobj = GGM(Data);
GGMobj.debias();

clear n_lambda;
end

% % Initialize Variables
Expand Down

0 comments on commit d90be24

Please sign in to comment.