Sum net input function
Syntax
N = netsum(Z1,Z2,...)
df = netsum('deriv')
Description
netsum
is a net input function. Net input functions calculate a layer's net input by combining its weighted inputs and biases.
netsum(Z1,Z2,...,Zn)
takes any number of inputs,
and returns N
, the element-wise sum of Zi
's.
netsum('deriv')
returns netsum
's derivative function.
Examples
Here netsum
combines two sets of weighted input vectors (which we have defined ourselves).
z1 = [1 2 4;3 4 1];
z2 = [-1 2 2; -5 -6 1];
n = netsum(z1,z2)
Here netsum
combines the same weighted inputs with a bias vector. Because Z1
and Z2
each contain three concurrent vectors, three concurrent copies of B
must be created with concur
so that all sizes match up.
b = [0; -1];
n = netsum(z1,z2,concur(b,3))
Network Use
You can create a standard network that uses netsum
by calling newp
or newlin
.
To change a network so a layer uses netsum,
set net.layers{i}.netInputFcn
to 'netsum
'.
In either case, call sim
to simulate the network with netsum
. See newp
or newlin
for simulation examples.
See Also
sim
,
dnetprod
,
netprod
,
concur
[ Previous | Help Desk | Next ]