-
Notifications
You must be signed in to change notification settings - Fork 7
/
module_TLapprox.m
23 lines (21 loc) · 1001 Bytes
/
module_TLapprox.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function [W, sparseCode, nonZeroTable] = ...
module_TLapprox(extractPatchAll, W, TLparam)
%MODULE_TLAPPROX Summary of this function goes here
% generate the sparse codes and learn transform
% Inputs:
% 1. W : initial Transform
% 2. extractPatchAll : the n * N data
% 3. TLparam : transform learning parameters
% Outputs:
% 1. W : learned transform
% 2. sparseCode : generated sparse codes
% 3. nonZeroTable : #non-zeros for each patch
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%% Parameters %%%%%%%%%%%%%%%
learningIter = TLparam.learningIter;
threshold = TLparam.threshold;
%%%%%%%%%%%%%%% Main Program %%%%%%%%%%%%%%%
W = TLORTHOpenalty(W, extractPatchAll, learningIter, threshold);
sparseCode = W * extractPatchAll;
[sparseCode, nonZeroTable] = sparse_l0(sparseCode, threshold);
end