Sigmoid Function

Author

Eric W. Weisstein
February 17, 2014

This notebook downloaded from http://mathworld.wolfram.com/notebooks/SpecialFunctions/SigmoidFunction.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/SigmoidFunction.html.

©2014 Wolfram Research, Inc. except for portions noted otherwise

Definition

LogisticSigmoid[x]//FunctionExpand

LogisticSigmoid[x]//TraditionalForm

Plots

<<Utilities`Plot`

Real Axis

PlotDiscontinuous[1/(1+Exp[-x]),{x,-5,5},
HorizontalAsymptotes->{0,1},AxesLabel->TraditionalForm/@{x,InlineFraction[1,1+Exp[-x]]}]

Plot[Evaluate[Table[1/(1+Exp[-a x]),{a,6}]],{x,-5,5},
AxesLabel->TraditionalForm/@{x,InlineFraction[1,1+Exp[-a x]]},
PlotStyle->{Red,Orange,Yellow,Green,Blue,Purple}]

Complex Plane

ComplexPlot3D[1/(1+Exp[-z]),{z,-5,5},
PlotPoints->100,
ComplexPlotLabel->InlineFraction[1,1+Exp[-z]]
]//Timing

ComplexContourPlot[1/(1+Exp[-z]),{z,-5,5},
ComplexPlotLabel->InlineFraction[1,1+Exp[-z]]
]//Timing

Series

y(x)==(∑_(n=0)^∞)((((((-1))^n) (EulerE2[n, 0])) (x^n))/(2 n!))==(∑_(n=0)^∞)((((((-1))^(n+1)) ((2^(n+1))-1) (BernoulliB[n+1])) (x^n))/((n+1)!))

SeriesCoefficient[LogisticSigmoid[x],{x,0,n}]

Table[SeriesCoefficient[LogisticSigmoid[x],{x,0,n}],{n,0,10}]

Table[(((((-1))^n)EulerE[n,0])/(2n!)),{n,0,10}]

Sum[(((((-1))^n)EulerE[n,0])/(2n!))(x^n),{n,0,∞}]

With[{x=.2},{LogisticSigmoid[x],Sum[(((((-1))^n)EulerE[n,0])/(2n!))(x^n),{n,0,100}]}]

Sum[(((-1)^(n + 1)*(2^(n + 1) - 1)*BernoulliB[n + 1])*x^n)/
   (n + 1)!, {n, 0, Infinity}]

With[{x=.2},{LogisticSigmoid[x],Sum[(((-1)^(n + 1)*(2^(n + 1) - 1)*BernoulliB[n + 1])*x^n)/
   (n + 1)!, {n, 0, 100}]}]

Sigmoid[x]

Series[Sigmoid[x],{x,0,10}]

SeriesCoefficient[Sigmoid[x],{x,0,n}]

Sum[(((((-1))^n) EulerE[n,0])/(2 n!))(x^n),{n,0,∞}]//Timing

Sum[(((((-1))^n) EulerE[n,0])/(2 n!))(x^n),{n,0,5}]

FullSimplify[(((((-1))^(n+1)) )/(2 n!))2BernoulliB[n+1]((2^(n+1))-1)/(n+1),n∈Integers&&n>=0]

Sum[(((((-1))^(n+1)) ((2^(1+n))-1) BernoulliB[1+n])/((n+1)!)) (x^n),{n,0,5}]

Sum[(((((-1))^(n+1)) ((2^(1+n))-1) BernoulliB[n+1])/((n+1)!)) (x^n),{n,0,∞}]//Timing

Integral and Derivative

Integrate

Integrate[LogisticSigmoid[x],x]//FullSimplify

D[%,x]//FullSimplify

Integrate[LogisticSigmoid[x]//FunctionExpand,x]//FullSimplify

Derivative

D[LogisticSigmoid[x],x]

FullSimplify[%]

FunctionExpand[%]//FullSimplify

Properties

sigmoid[x_]:=1/(1+Exp[-x])

ODE

Simplify[y'[x]-y[x](1-y[x])/.y:>sigmoid]

Simplify[y'[x]-y[x](1-y[x])/.y:>Sigmoid]

DSolve[f'[x]-f[x](1-f[x])==0,f[x],x]

FullSimplify[%]

Infelction Point

FullSimplify[sigmoid''[x]]

FullSimplify[Sigmoid''[x]]

Solve[FullSimplify[y''[x]]==0,x]