% function [D error] = Occlusion_Dict_Learn (X,D_init, Iter_n, lambda)
%
%  X:        the original data matrix, each column is a sample
%  D_init:   the initialized dictionary
%  Iter_n:   the maximal iteration number
%  lambda:   the parameter in l1_ls



function [D error] = Occlusion_Dict_Learn (X,D_init, Iter_n, lambda)

D   =   single(D_init);
error  =  [];

for itn =  1:Iter_n  
[D,Jnow]  = Metaface_single_iteration(single(X),D,lambda,itn);
error     = [error, Jnow]
end