下面给出一个简单的例子:
1 readme
% ========================================================================
% Coupled Dictionary Learning, Version 1.0
% Copyright(c) 2016 P. Zhu etl.
% All Rights Reserved.
%
% ----------------------------------------------------------------------
% Permission to use, copy, or modify this software and its documentation
% for educational and research purposes only and without fee is here
% granted, provided that this copyright notice and the original authors'
% names appear on all copies and supporting documentation. This program
% shall not be used, rewritten, or adapted as the basis of a commercial
% software or hardware product without first obtaining permission of the
% authors. The authors make no representations about the suitability of
% this software for any purpose. It is provided "as is" without express
% or implied warranty.
% ----------------------------------------------------------------------
%
% Please refer to the following paper
Zhu P, Hu Q, Zhang C, et al. Coupled Dictionary Learning for Unsupervised
Feature Selection[C]//Thirtieth AAAI Conference on Artificial Intelligence. 2016.
%
% bibtex
@inproceedings{zhu2016coupled,
title={Coupled Dictionary Learning for Unsupervised Feature Selection},
author={Zhu, Pengfei and Hu, Qinghua and Zhang, Changqing and Zuo, Wangmeng},
booktitle={Thirtieth AAAI Conference on Artificial Intelligence},
year={2016}
}
%
%
%
% Contact: {zhupengfei}@tju.edu.cn
% ----------------------------------------------------------------------
3 m文件
function [V,U]=CDLFS(X,mu,tau,DictSize,p)
%%
% The function is to sove the following optimization problem
% min_{U,V} ||X-UV'X||_F^2+tau*||V||_{2,p}
% Input:
%X feature matrix d*n d is feature dimension n is sample number
%mu parameter default value 1
%tau parameter
%DictSize dictionary size default value 10
%p L2p-norm regularization default value {0.4,0.6,0.8,1.0}
% reference:
% [1]Zhu P, Hu Q, Zhang C, et al. Coupled Dictionary Learning for Unsupervised Feature Selection[C]//Thirtieth AAAI Conference on Artificial Intelligence. 2016.