-
大小: 15.01MB文件類型: .zip金幣: 2下載: 0 次發(fā)布日期: 2023-07-22
- 語(yǔ)言: Matlab
- 標(biāo)簽:
資源簡(jiǎn)介
經(jīng)典文獻(xiàn)“Non-negative Matrix Factorization with
Sparseness Constraints”的實(shí)現(xiàn)代碼(MATLAB)
代碼片段和文件信息
function?V?=?cbcldata
%?cbcldata?-?read?face?image?data?from?cbcl?database
%
global?imloadfunc;
????
%?This?is?where?the?cbcl?face?images?reside
thepath?=?‘../data/cbcl-face-database/face/‘;
%?Create?the?data?matrix
V?=?zeros(19*192429);
%?Read?the?directory?listing
D?=?dir(thepath);
%?Step?through?each?image?reading?it?into?the?data?matrix
%?Note:?The?(+2)?is?just?to?avoid?‘.‘?and?‘..‘?entries
fprintf(‘Reading?in?the?images...\n‘);
for?i=1:2429
????switch?imloadfunc
?????case?‘pgma_read‘
??????I?=?pgma_read([thepath?D(i+2).name]);
?????otherwise
??????I?=?imread([thepath?D(i+2).name]);
????end
????V(:i)?=?reshape(I[19*19?1]);
????if?rem(i100)==1?fprintf(‘[%d/24]‘floor(i/100));?end
end
fprintf(‘\n‘);
%?Same?preprocessing?as?Lee?and?Seung
V?=?V?-?mean(V(:));
V?=?V?/?sqrt(mean(V(:).^2));
V?=?V?+?0.25;
V?=?V?*?0.25;
V?=?min(V1);
V?=?max(V0);
%?Additionally?this?is?required?to?avoid?having?any?exact?zeros:
%?(divergence?objective?cannot?handle?them!)
V?=?max(V1e-4);
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2006-08-03?11:02??nmfpack\
?????文件????????6862??2006-08-03?11:02??nmfpack\README
?????目錄???????????0??2006-08-03?11:02??nmfpack\code\
?????文件????????4932??2006-08-03?11:02??nmfpack\code\nmfsc.m
?????文件?????????569??2006-08-03?11:02??nmfpack\code\natdata.m
?????文件????????6585??2006-08-03?11:02??nmfpack\code\main.m
?????文件????????1914??2006-08-03?11:02??nmfpack\code\nmfdiv.m
?????文件?????????933??2006-08-03?11:02??nmfpack\code\sampleimages.m
?????文件????????1551??2006-08-03?11:02??nmfpack\code\visual.m
?????文件????????3209??2006-08-03?11:02??nmfpack\code\projtest.m
?????文件????????1841??2006-08-03?11:02??nmfpack\code\nmfmse.m
?????文件????????2019??2006-08-03?11:02??nmfpack\code\snmf.m
?????文件????????2010??2006-08-03?11:02??nmfpack\code\lnmf.m
?????文件????????1002??2006-08-03?11:02??nmfpack\code\cbcldata.m
?????文件????????1257??2006-08-03?11:02??nmfpack\code\orldata.m
?????文件????????1509??2006-08-03?11:02??nmfpack\code\projfunc.m
?????文件????????3993??2006-08-03?11:02??nmfpack\code\pgma_read.m
?????目錄???????????0??2006-08-03?11:02??nmfpack\data\
?????目錄???????????0??2006-08-03?11:02??nmfpack\data\cbcl-face-databa
?????目錄???????????0??2006-08-03?11:03??nmfpack\data\orl-faces\
?????目錄???????????0??2006-08-03?11:02??nmfpack\data\orl-faces\s1\
?????文件???????10318??2006-08-03?11:02??nmfpack\data\orl-faces\s1\1.pgm
?????文件???????10318??2006-08-03?11:02??nmfpack\data\orl-faces\s1\10.pgm
?????文件???????10318??2006-08-03?11:02??nmfpack\data\orl-faces\s1\2.pgm
?????文件???????10318??2006-08-03?11:02??nmfpack\data\orl-faces\s1\3.pgm
?????文件???????10318??2006-08-03?11:02??nmfpack\data\orl-faces\s1\4.pgm
?????文件???????10318??2006-08-03?11:02??nmfpack\data\orl-faces\s1\5.pgm
?????文件???????10322??2006-08-03?11:02??nmfpack\data\orl-faces\s1\6.pgm
?????文件???????10321??2006-08-03?11:02??nmfpack\data\orl-faces\s1\7.pgm
?????文件???????10318??2006-08-03?11:02??nmfpack\data\orl-faces\s1\8.pgm
?????文件???????10318??2006-08-03?11:02??nmfpack\data\orl-faces\s1\9.pgm
............此處省略434個(gè)文件信息
評(píng)論
共有 條評(píng)論