Skip to content

Commit 43b6ae4

Browse files
committed
p = 0 gives back HALS NMF
1 parent 64e4663 commit 43b6ae4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

update_temporal_components.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@
135135
% if flag_G
136136
% G = make_G_matrix(T,P.g{ii});
137137
% end
138+
if options.p == 0
139+
YrA(:,ii) = YrA(:,ii) + nA(ii)*Cin(ii,:)';
140+
maxy = max(YrA(:,ii)/nA(ii));
141+
cc = max(YrA(:,ii)/nA(ii)/maxy,0);
142+
C(ii,:) = full(cc')*maxy;
143+
YrA(:,ii) = YrA(:,ii) - nA(ii)*C(ii,:)';
144+
S(ii,:) = C(ii,:);
145+
else
138146
switch method
139147
case 'project'
140148
YrA(:,ii) = YrA(:,ii) + nA(ii)*Cin(ii,:)';
@@ -194,6 +202,7 @@
194202
Y_res = Y_res - A(:,ii)*cc';
195203
S(ii,:) = C(ii,:)*G';
196204
end
205+
end
197206
else
198207
YrA(:,ii) = YrA(:,ii) + nA(ii)*Cin(ii,:)';
199208
cc = max(YrA(:,ii)/nA(ii),0);

0 commit comments

Comments
 (0)