Neural Network Toolbox |
Graph and Symbol
Syntax
Description
compet is a transfer function. Transfer functions calculate a layer's output from its net input.
compet(N)
takes one input argument,
and returns output vectors with 1 where each net input vector has its maximum value, and 0 elsewhere.
compet(code)
returns information about this function.
compet
does not have a derivative function
In many network paradigms it is useful to have a layer whose neurons compete for the ability to output a 1. In biology this is done by strong inhibitory connections between each of the neurons in a layer. The result is that the only neuron that can respond with appreciable output is the neuron whose net input is the highest. All other neurons are inhibited so strongly by the winning neuron that their outputs are negligible.
To model this type of layer efficiently on a computer, a competitive transfer function is often used. Such a function transforms the net input vector of a layer of neurons so that the neuron receiving the greatest net input has an output of 1 and all other neurons have outputs of 0.
Examples
Here we define a net input vector N
, calculate the output, and plot both with bar graphs.
n = [0; 1; -0.5; 0.5]; a = compet(n); subplot(2,1,1), bar(n), ylabel('n') subplot(2,1,2), bar(a), ylabel('a')
Network Use
You can create a standard network that uses compet by calling newc
or newpnn
.
To change a network so a layer uses compet, set net.layers{i,j}.transferFcn
to 'compet
'.
In either case, call sim
to simulate the network with compet.
See newc
or newpnn
for simulation examples.
See Also
combvec | con2seq |
© 1994-2005 The MathWorks, Inc.