📄 prop1.m
字号:
function [out]=prop1(in,w,b,t,f);
%
% Propagates an input vector
% through one layer of a network
%
% call:
%
% [out]=prop(in,w,b,t);
%
% w = weight matrix
% b = bias weights (column vector. Same size a second layer)
% in = input vector
% out = propagated signal
% t = transfer option:
% = 1 Linear transfer with bias
% = 2 Sigmoidal transfer
% = 3 Linear transfer without bias
% f = filter constants for this layer
%
% [Uses the MATLAB filter routine, otherwise it would be stupidly
% slow!]
%
%
% Determine the size of the two layers
%
[prsize thsize]=size(w);
%
% Calculate the input for each neuron
% in the second layer
%
if t == 2
net=in*w;
for i = 1:thsize
net(:,i)=net(:,i)+b(i);
end
net=sig(net);
elseif t == 1
net=in*w;
for i = 1:thsize
net(:,i)=net(:,i)+b(i);
end
elseif t == 3
net=in*w;
end
[D L]=size(net);
for i = 1:L
% x1=net(1,i);
% net(:,i)=net(:,i)-x1;
out(:,i)=filter([1-f(i)],[1 -f(i)],net(:,i));
% out(:,i)=out(:,i)+x1;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -