natdata.m
来自「NMFs算法(带稀疏度约束的非负稀疏矩阵分解)用于实现基于人脸局部特征的人脸识别」· M 代码 · 共 24 行
M
24 行
function V = natdata% natdata - read natural image data preprocessed into ON/OFF channels%% Data parameterswsize = 12;samples = 10000; % Sample image patches from pre-whitened Olshausen's imagesZ = sampleimages( wsize, samples ); % Separate into ON and OFF channels.Y = Z; Y(Y<0)=0; Z(Z>0)=0; Z=-Z;V = [Y; Z];% Additionally, this is required to avoid having any exact zeros:% (divergence objective cannot handle them!)V = max(V,1e-4);% Normalize each channel to unit mean squared activationV = V./(sqrt(mean(V.^2,2))*ones(1,size(V,2)));
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?