Algorithm 1.
Input: Initial dictionary D and image patches {x1, ··· , xn}. | |
Output: The learned dictionary and coefficients D, Z where Z = {z1, ··· , zn}. | |
1: | for t = 1 to T do |
2: | for i = 1 to n do |
3: | Get an image patch xi |
4: | Calculate the sparse code zi by using several steps of coordinate descent (CD) [11]. zi,t+1 = CD(Dt, zi,t, xi) |
5: | Update the dictionary D by performing on step stochastic gradient descent (SGD) [11]. Dt+1 = SGD(Dt, zi,t+1) |
6: | end for |
7: | end for |