Activations

Activations

Sigmoid

Sigmoid function is a function that has a characteristic S-shaped curve.

logistic function

σ(x)11+ex\sigma(x) \doteq \frac{1}{1 + e^{-x}}

Properties

σ(x)=11+ex=exex+1  (multiplied with ex/ex)=1+ex11+ex=11ex+1=1σ(x)\begin{align*} \sigma(-x) &= \frac{1}{1 + e^{x}} = \frac{e^{-x}}{e^{-x} + 1} ~~(\because \text{multiplied with } e^{-x} / e^{-x}) \\ &= \frac{{\color{magenta}1} + e^{-x} {\color{magenta}- 1}}{1 + e^{-x}} = 1 - \frac{1}{e^{-x} + 1} \\ &= 1 - \sigma(x) \end{align*}

derivative:

xσ(x)=1(1+ex)2(ex)=ex(1+ex)2=1+ex1(1+ex)2=11+ex1(1+ex)2=11+ex(111+ex)=σ(x)(1σ(x))=σ(x)σ(x)\begin{align*} \frac{\partial}{\partial x} \sigma(x) &= - \frac{1}{(1 + e^{-x})^2} \cdot (-e^{-x}) \\ &= \frac{e^{-x}}{(1 + e^{-x})^2} = \frac{1 + e^{-x} - 1}{(1 + e^{-x})^2} \\ &= \frac{1}{1 + e^{-x}} - \frac{1}{(1 + e^{-x})^2} \\ &= \frac{1}{1 + e^{-x}} \left( 1 - \frac{1}{1 + e^{-x}} \right) \\ &= \sigma(x)(1 - \sigma(x)) \quad = \sigma(x)\sigma(-x) \end{align*}

Hyperbolic tangent

f(x)=exexex+exf(x) = \frac{e^x - e^{-x}}{e^x + e^{-x}}