|
Algorithm 2 K-SVD algorithm |
|
Task: Find the best dictionary to represent the data samples , as sparse compositions by solving:
|
|
Initialization: Set the dictionary matrix with normalized columns. Set .
|
Iterations: Repeat until convergence:
Sparse coding stage: Use any pursuit algorithm to compute the representation vectors for each sample by approximating the solution of
Dictionary update stage: For each column in ,
-
-
Define the group of samples that use this atom,
-
-
Compute the overall representation error matrix, , by
-
-
Restrict by choosing only the columns corresponding to , and obtain .
-
-
Apply SVD decomposition . Choose the updated dictionary column to be the first column of U. Update the coefficient vector to be the first column of V multiplied by .
Set .
|