compet
(To be removed) Competitive transfer function
compet will be removed in a future release. For more information,
see Transition Legacy Neural Network Code to dlnetwork Workflows.
For advice on updating your code, see Version History.
Graph and Symbol

Syntax
A = compet(N,FP)
info = compet('code')
Description
compet is a neural transfer function. Transfer functions calculate
a layer’s output from its net input.
A = compet(N,FP) takes N and optional function
parameters,
N |
|
FP | Struct of function parameters (ignored) |
and returns the S-by-Q matrix
A with a 1 in each column where the same
column of N has its maximum value, and 0
elsewhere.
info = compet(' returns
information according to the code string specified:code')
compet('name') returns the name of this function.
compet('output',FP) returns the [min max] output
range.
compet('active',FP) returns the [min max] active
input range.
compet('fullderiv') returns 1 or
0, depending on whether dA_dN is
S-by-S-by-Q or
S-by-Q.
compet('fpnames') returns the names of the function
parameters.
compet('fpdefaults') returns the default function parameters.
Examples
Here you 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')
Assign this transfer function to layer i of a network.
net.layers{i}.transferFcn = 'compet';
Version History
Introduced before R2006aSee Also
Time Series
Modeler | fitrnet (Statistics and Machine Learning Toolbox) | fitcnet (Statistics and Machine Learning Toolbox) | trainnet | trainingOptions | dlnetwork