| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Neural Network Toolbox |
| Contents | Index |
Hyperbolic tangent sigmoid transfer function
tansig is a neural transfer function. Transfer functions calculate a layer's output from its net input.
tansig(N,FP) takes N and optional function parameters,
| N |
S x Q matrix of net input (column) vectors |
| FP |
Struct of function parameters (ignored) |
and returns A, the S x Q matrix of N's elements squashed into [-1 1].
tansig('dn',N,A,FP) returns the derivative of A with respect to N. If A or FP is not supplied or is set to [], FP reverts to the default parameters, and A is calculated from N.
tansig('name') returns the name of this function.
tansig('output',FP) returns the [min max] output range.
tansig('active',FP) returns the [min max] active input range.
tansig('fullderiv') returns 1 or 0, depending on whether dA_dN is S x S x Q or S x Q.
tansig('fpnames') returns the names of the function parameters.
tansig('fpdefaults') returns the default function parameters.
Here is the code to create a plot of the tansig transfer function.
Assign this transfer function to layer i of a network.
This is mathematically equivalent to tanh(N). It differs in that it runs faster than the MATLAB® implementation of tanh, but the results can have very small numerical differences. This function is a good tradeoff for neural networks, where speed is important and the exact shape of the transfer function is not.
Vogl, T.P., J.K. Mangis, A.K. Rigler, W.T. Zink, and D.L. Alkon, "Accelerating the convergence of the backpropagation method," Biological Cybernetics, Vol. 59, 1988, pp. 257-263
| Provide feedback about this page |
![]() | sse | train | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |