资 源 简 介
function [D,Gamma,err,gerr] = ksvd(params,varargin)%KSVD K-SVD dictionary training.% [D,GAMMA] = KSVD(PARAMS) runs the K-SVD dictionary training algorithm on% the specified set of signals, returning the trained dictionary D and the% signal representation matrix GAMMA.%% KSVD has two modes of operation: sparsity-based and error-based. For% sparsity-based minimization, the optimization problem is given by%% min |X-D*GAMMA|_F^2 s.t. |Gamma_i|_0 <= T% D,Gamma%% where X is the set of training signals, Gamma_i is the i-th column of% Gamma, and T is the target sparsity. For error-based minimization, the% optimization problem is given by%% min |Gamma|_0 s.t. |X_i - D*Gamma_i|_2 <= EPSILO