prm_distribution.m

来自「这是用matlab编写人脸检测软件」· M 代码 · 共 25 行

M
25
字号
%*************************************************************************
%  using the prm providing with the distribution DD over the training sample
%
%***************************************************************************
%  
%***************************************************************************
function yClass = prm_distribution(Y,trainY,train_label,DD,CLASSNUM,EACHNUM)
% ResampleCount = zeros(size(trainY,1),1);
% ResampleLabel = zeros(1,1);
ResampleSize = CLASSNUM*(EACHNUM) -1;
for temp = 1:ResampleSize
    nRand = RandWithDistribution(DD,CLASSNUM*EACHNUM);    
    ResampleData(:,temp) = trainY(:,nRand);
    ResampleLabel(:,temp) = train_label(nRand);
end
% for temp = 1:EACHNUM:CLASSNUM*EACHNUM
%      ResampleData(:,tempIndex:tempIndex) = trainY(:,temp); 
%      ResampleLabel(:,tempIndex:tempIndex) = train_label(temp);
%      tempIndex = tempIndex + 1;
%      ResampleData(:,tempIndex:tempIndex) = trainY(:,temp+1); 
%      ResampleLabel(:,tempIndex:tempIndex) = train_label(temp+1);
%      tempIndex = tempIndex + 1;    
% end
yClass = prm(Y,ResampleData,ResampleLabel,CLASSNUM);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?