Neural Network Toolbox | ![]() ![]() |
Calculate network signals for one time step
Syntax
[Ac,N,LWZ,IWZ,BZ] = calca1(net,Pd,Ai,Q)
Description
This function calculates the outputs of each layer in response to a network's delayed inputs and initial layer
delay conditions, for a single time step.
Calculating outputs for a single time step is useful for sequential iterative algorithms such as trains
, which need to calculate the network response for each time step individually.
[Ac,N,LWZ,IWZ,BZ] = calca1(net,Pd,Ai,Q)
takes,
Neural network.
net -
Delayed inputs for a single time step.
Pd -
Ai -
Initial layer delay conditions for a single time step.
Q -
Concurrent size.
A -
Layer outputs for the time step.
N -
Net inputs for the time step.
LWZ -
Weighted layer outputs for the time step.
IWZ -
Weighted inputs for the time step.
BZ -
Concurrent biases for the time step.
Examples
Here we create a linear network with a single input element ranging from 0 to 1, three neurons, and a tap delay on the
input with taps at zero, two, and four time steps. The network is
also given a recurrent connection from layer 1 to itself with
tap delays of [1 2].
net = newlin([0 1],3,[0 2 4]);
net.layerConnect(1,1) = 1;
net.layerWeights{1,1}.delays = [1 2];
Here is a single (Q = 1
) input sequence P
with eight time steps (TS = 8
), and the four initial input delay conditions Pi
, combined inputs Pc
, and delayed inputs
Pd
.
P = {0 0.1 0.3 0.6 0.4 0.7 0.2 0.1};
Pi = {0.2 0.3 0.4 0.1};
Pc = [Pi P];
Pd = calcpd(net,8,1,Pc)
Here the two initial layer delay conditions for each of the three neurons are defined:
Ai = {[0.5; 0.1; 0.2] [0.6; 0.5; 0.2]};
Here we calculate the network's combined outputs Ac
, and other signals described above.
[Ac,N,LWZ,IWZ,BZ] = calca(net,Pd,Ai,1,8)
![]() | calca | calce | ![]() |