Mercurial > hg > smallbox
view DL/Majorization Minimization DL/ExactDicoRecovery/mapfn.m @ 186:9c418bea7f6a bug_386
Addresses Bug #386: removed the 4th output variable (versn) in all calls of function fileparts.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Thu, 09 Feb 2012 17:25:14 +0000 |
parents | b14209313ba4 |
children |
line wrap: on
line source
%% Maximum A Posteriori Dictionary Learning with the constraint on the column norms %%%%% function [Phiout,unhatnz] = mapfn(Phi,x,unhat,mu,maxIT,eps,phim,res) K = Phi; B = zeros(size(Phi,1),size(Phi,2)); i = 1; while (sum(sum((B-K).^2))>eps)&&(i<=maxIT) B = K; E = x-K*unhat; K = K+mu*(phim*E*unhat'-trace(unhat*E'*K)*K); i = i+1; end %%% depleted atoms cancellation %%% [Y,I] = sort(sum(K.^2),'descend'); RR = phim; Phiout = K(:,I(1:RR)); unhatnz = unhat(I(1:RR),:);