Skip to content

Commit

Permalink
p = 0 gives back HALS NMF
Browse files Browse the repository at this point in the history
  • Loading branch information
epnev committed Dec 1, 2015
1 parent 64e4663 commit 43b6ae4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions update_temporal_components.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@
% if flag_G
% G = make_G_matrix(T,P.g{ii});
% end
if options.p == 0
YrA(:,ii) = YrA(:,ii) + nA(ii)*Cin(ii,:)';
maxy = max(YrA(:,ii)/nA(ii));
cc = max(YrA(:,ii)/nA(ii)/maxy,0);
C(ii,:) = full(cc')*maxy;
YrA(:,ii) = YrA(:,ii) - nA(ii)*C(ii,:)';
S(ii,:) = C(ii,:);
else
switch method
case 'project'
YrA(:,ii) = YrA(:,ii) + nA(ii)*Cin(ii,:)';
Expand Down Expand Up @@ -194,6 +202,7 @@
Y_res = Y_res - A(:,ii)*cc';
S(ii,:) = C(ii,:)*G';
end
end
else
YrA(:,ii) = YrA(:,ii) + nA(ii)*Cin(ii,:)';
cc = max(YrA(:,ii)/nA(ii),0);
Expand Down

0 comments on commit 43b6ae4

Please sign in to comment.