-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgroup_hard_iterative_thresholding.m
More file actions
47 lines (41 loc) · 1.44 KB
/
group_hard_iterative_thresholding.m
File metadata and controls
47 lines (41 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function C = group_hard_iterative_thresholding(Dgroup,rhsgroup,ds,Cinitial,thres,numIter)
% Solve
%
% min_{c1,...,cm} \|D1 * c1 - b1\|_2^2 + ... \|Dm * cm - bm\|_2^2 + gamma * \|[c1,..., cm]\|_{2,0}
%
% where \|A\|_{2,0} = number of non-zero rows of the matrix A.
% Input:
% Dgroup = {D1,...,Dm} where Dk is of size l_k x nbar
% rhsgroup = {v1,...,vm} where vk is of size l_k x 1
% Cinitial = Initial values of the unknown matrix C=[c1... cm]
% thres = thresholding parameter (=\sqrt(gamma))
% numIter = number of group hard-iterative algorithm
% Output:
% C = matrix of size nbar x m
%
% Copyright: Hayden Schaeffer, Giang Tran, Rachel Ward
% More information can be found at:
% H. Schaeffer, G. Tran and R. Ward, "Learning Dynamical Systems and
% Bifurcation via Group Sparsity", https://arxiv.org/abs/1709.01558
m = size(Dgroup,1);
C = Cinitial;
for j = 1:numIter
% gradient-descent step
for i = 1:m
ctemp = C(:,i);
Dtemp = Dgroup{i};
A = (Dtemp)'*Dtemp;
b = Dtemp'*rhsgroup{i};
ctemp = ctemp - ds*(A*ctemp - b);
Cthres(:,i) = ctemp(:);
end
C_sum = sqrt(sum( Cthres.^2,2));
Index = C_sum < (thres);
NIndex = C_sum>= (thres);
for i = 1:m
C(Index,i) = 0;
Dtemp = Dgroup{i};
C(NIndex,i) = Dtemp(:,NIndex)\rhsgroup{i};
end
end
return;