prop.m

来自「收集的GA的一些源程序」· M 代码 · 共 30 行

M
30
字号
function out=prop1(in,w,b);
%
% Propagates an input vector
% through one layer of a network
%
% call:
%
% [out]=prop(in,w);
%
% w   = weight matrix
% b   = bias weights (column vector. Same size a second layer)
% in  = input vector
% out = propagated signal
%

%
% Determine the size of the two layers
%
[prsize thsize]=size(w);

%
% Calculate the input for each neuron
% in the second layer
%
net=[];
for i = 1:thsize
	net(i)=sig(sum(in.*w(:,i))+b(i));
end
out=net;

⌨️ 快捷键说明

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