• 大小: 9.19MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-25
  • 语言: Matlab
  • 标签: src1_9  

资源简介

稀疏表示算法(Sparse Representation Classification,SRC)一种广泛应用于人脸识别的算法。

资源截图

代码片段和文件信息

function testClassPredicted=bootstrapnnlsClassifier(trainSettrainClasstestSettestClassoption)
% Bootstrap NNLS Classifier: testSet=trainSet*Y s.t. Y>=0.
% Usage:
% [testClassPredictedsparsity]=bootstrapnnlsClassifier(trainSettrainClass[]testClass)
% [testClassPredictedsparsity]=bootstrapnnlsClassifier(trainSettrainClasstestSettestClass)
% [testClassPredictedsparsity]=bootstrapnnlsClassifier(trainSettrainClasstestSettestClassoption)
% trainSet matrix the training set with samples in columns and features in rows.
% trainClass: column vector of numbers or string the class labels of the traning set.
% testSet: matrix the test set.
% testClass: column vector of numbers or string the class labels of the
% test/unknown set. It is actually unused in this function thus set it [].
% option: struct the options to configue this function:
% option.method string the optimization algorithm used to solve the NNLS problem. It could be
%     ‘nnls‘: used the NNLS algorithm (default);
%     ‘seminmfupdaterule‘: use the update rules based algorithm;
%     ‘sparsennls‘: used NNLS algorithm with sparse constraint.
% option.predicter: the method to find the class label of a test sample according to Y. It could be
%     ‘max‘: the same class label with the training sample with the maximum coefficient (default);
%     ‘kvote‘: select k training samples with the k largest coefficients and decide the class labels by majority voting.
% option.kernel string specifies the kernel. can be ‘linear‘(default)‘polynomial‘‘rbf‘‘sigmoid‘‘ds‘
% option.param scalar or column vector the parameters for kernels the default is [].
% option.kernelParamRandomAssign: logical if randomly assign the
% parameters the default is false.
% option.k: scalar only for option.predicter=‘kvote‘. The default is 1.
% option.numRandom scalar the times to use bootstrapping. The default is 99.
% testClassPredicted: column vector the predicted class labels of the test/unknown samples.
% sparsity: scalar the sparsity of the coefficient matrix Y.
% References:
%  [1]\bibitem{nips2011}
%     Y. Li and A. Nogm
%     ‘‘Non-neagtive least squares classifier‘‘
%     {\it Advances in Neural Information Processing Systems}
%     submitted. 
%     Available at \url{http://cs.uwindsor.ca/~li11112c/doc/nips2011.pdf}
% Contact Information:
% Yifeng Li
% University of Windsor
% li11112c@uwindsor.ca; yifeng.li.cn@gmail.com
% May 23 2011



if nargin<5
   option=[]; 
end
optionDefault.method=‘nnls‘;
optionDefault.predicter=‘max‘;
optionDefault.kernel=‘linear‘;
optionDefault.param=[];
optionDefault.kernelParamRandomAssign=false;
optionDefault.k=1;
optionDefault.numRandom=99;
option=mergeOption(optionoptionDefault);

trainSetOrigin=trainSet;
trainClassOrigin=trainClass;
testSetOrigin=testSet;

if size(trainSetOrigin3)>1 % tensor
    trainSetOrigin=matrizicing(trainSetOrigin3);
    testSet=matrizicing(testSetOrigin3

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-03-07 07:27  srv1_9\
     文件        3508  2015-03-02 21:56  srv1_9\readMe.txt
     文件         509  2015-03-02 20:47  srv1_9\exampleUSR.m
     文件         858  2013-02-14 20:23  srv1_9\wvote.m
     文件        7186  2015-03-07 07:10  srv1_9\vsmf.m
     文件         821  2011-10-11 17:00  srv1_9\vote.m
     文件         290  2010-09-28 04:54  srv1_9\vec2mat.m
     文件        4308  2013-02-23 00:12  srv1_9\usr.m
     文件        1397  2011-10-11 17:10  srv1_9\unmatrizicing.m
     文件        4116  2013-02-04 09:04  srv1_9\threeDSearchUniverse.m
     文件        1975  2013-07-11 02:27  srv1_9\subspace.m
     文件        3170  2015-03-02 18:45  srv1_9\SRC2.m
     文件        3150  2011-12-17 02:32  srv1_9\src.m
     文件         372  2013-07-11 00:07  srv1_9\sparsity.m
     文件        1450  2012-01-12 02:46  srv1_9\sparsenmfnnlstest.m
     文件        7046  2012-11-11 21:25  srv1_9\softSVMTrain2.m
     文件        2178  2012-09-15 23:53  srv1_9\softSVMPredict2.m
     文件        3206  2012-11-25 08:53  srv1_9\significantAcc.m
     文件         961  2011-11-19 03:51  srv1_9\sampleSelNNLS.m
     文件         493  2011-11-19 04:03  srv1_9\sampleSelKNN.m
     文件         570  2011-10-11 16:43  srv1_9\pseudoinverse.m
     文件         486  2013-04-04 06:19  srv1_9\proximalOperator.m
     文件         399  2012-04-04 22:35  srv1_9\plotTime.m
     文件        1795  2012-11-25 08:59  srv1_9\plotNemenyiTest.m
     文件        1808  2012-04-05 07:03  srv1_9\plotDataMulti.m
     文件        2525  2013-02-19 22:13  srv1_9\plotBarError.m
     文件        4100  2012-08-10 00:12  srv1_9\perform.m
     文件         869  2011-10-11 17:14  srv1_9\normmean0std1.m
     文件         175  2011-11-19 03:35  srv1_9\normcl1.m
     文件         393  2012-02-17 09:22  srv1_9\normalizeKernelMatrix.m
     文件         248  2013-05-22 23:09  srv1_9\NNQPSMOMulti.m
............此处省略100个文件信息

评论

共有 条评论

相关资源