⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trainperceptron.m

📁 patten regnization source从1-14章能运行
💻 M
字号:
%%% 欺剂飘沸  切嚼 颇老function [newWts] = trainPerceptron(patNum,wts,pats,targ,lrate)nOutputs = size(targ,1);for i = 1:nOutputs,   inputVector = pats(:,patNum);   targetOutput = targ(i,patNum);   totalInput = dot(wts(i,:),inputVector);   if (totalInput > 0)      activation = 1;   else activation = -1;   end	   if (activation > targetOutput)     %% unit is on but should be off      wts(i,:) = wts(i,:) - lrate * inputVector';   elseif (activation < targetOutput)     %% unit is off but should be on     wts(i,:) = wts(i,:) + lrate * inputVector';   endend newWts = wts;

⌨️ 快捷键说明

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