Mercurial > hg > smallbox
comparison DL/Majorization Minimization DL/ExactDicoRecovery/mapfn.m @ 155:b14209313ba4 ivand_dev
Integration of Majorization Minimisation Dictionary Learning
author | Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk> |
---|---|
date | Mon, 22 Aug 2011 11:46:35 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
154:0de08f68256b | 155:b14209313ba4 |
---|---|
1 %% Maximum A Posteriori Dictionary Learning with the constraint on the column norms %%%%% | |
2 function [Phiout,unhatnz] = mapfn(Phi,x,unhat,mu,maxIT,eps,phim,res) | |
3 K = Phi; | |
4 B = zeros(size(Phi,1),size(Phi,2)); | |
5 i = 1; | |
6 while (sum(sum((B-K).^2))>eps)&&(i<=maxIT) | |
7 B = K; | |
8 E = x-K*unhat; | |
9 K = K+mu*(phim*E*unhat'-trace(unhat*E'*K)*K); | |
10 i = i+1; | |
11 end | |
12 %%% depleted atoms cancellation %%% | |
13 [Y,I] = sort(sum(K.^2),'descend'); | |
14 RR = phim; | |
15 Phiout = K(:,I(1:RR)); | |
16 unhatnz = unhat(I(1:RR),:); |