hardlims
(To be removed) Symmetric hard-limit transfer function
hardlims 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 = hardlims(N,FP)
Description
hardlims is a neural transfer function. Transfer functions
calculate a layer’s output from its net input.
A = hardlims(N,FP) takes N and optional
function parameters,
N |
|
FP | Struct of function parameters (ignored) |
and returns A, the S-by-Q
+1/–1 matrix with +1s where N ≥ 0.
info = hardlims(' returns
information according to the code string specified:code')
hardlims('name') returns the name of this function.
hardlims('output',FP) returns the [min max]
output range.
hardlims('active',FP) returns the [min max]
active input range.
hardlims('fullderiv') returns 1 or 0, depending on whether
dA_dN is
S-by-S-by-Q or
S-by-Q.
hardlims('fpnames') returns the names of the function
parameters.
hardlims('fpdefaults') returns the default function
parameters.
Examples
Here is how to create a plot of the hardlims transfer
function.
n = -5:0.1:5; a = hardlims(n); plot(n,a)
Assign this transfer function to layer i of a network.
net.layers{i}.transferFcn = 'hardlims';
Algorithms
hardlims(n) = 1 if n ≥ 0, –1 otherwise.
Version History
Introduced before R2006aSee Also
Time Series
Modeler | fitrnet (Statistics and Machine Learning Toolbox) | fitcnet (Statistics and Machine Learning Toolbox) | trainnet | trainingOptions | dlnetwork