# Sigmoid Neuron

A Sigmoid Neuron is an artificial neuron that uses a Logistic Sigmoid Activation Function.

• AKA: Sigmoidal Neuron, Logistic Neuron, Log-Sigmoid Neuron, Sigmoid Neural Unit.
• Context:
• It can be mathematically described as

$\displaystyle{ y_j=\sigma(z_j)=1/(1+e^{-z_j})\quad \text{with} \quad z_j=\sum_{i=0}^nw_{ji}x_i+b \quad \text{for}\quad j=0,\cdots, p }$

where $\displaystyle{ x_i }$ are the Neural Network Input vector, $\displaystyle{ y_j }$ are the Neural Network Output vector, $\displaystyle{ w_{ji} }$ is the Neural Network Weights and $\displaystyle{ b }$ is the Bias Neuron.

• Example(s):
• Let's consider a sigmoid neuron with 3 inputs $\displaystyle{ \{x_1,x_2,x_3\} }$, 3 neural network weight values $\displaystyle{ \{w_1,w_2,w_3\} }$ and bias value $\displaystyle{ b }$. The output is given by $\displaystyle{ y=1/(1+e-z) }$ with $\displaystyle{ z=w_1*x_1+w_2*x_2+w_3*x_3 + b }$.
• Let's consider a sigmoid neuron with 3 inputs $\displaystyle{ X=\{0.5699, 0.1250, 0.5925\} }$, 3 neural network weight values $\displaystyle{ W=\{0.2217, 0.5029, 0.1168\} }$ and bias value $\displaystyle{ b=0.02 }$. The output is $\displaystyle{ y=1/(1+e^{-0.2780})=0.5691 }$ as $\displaystyle{ z=0.221*0.56997+0.5029*0.1250+0.1168*0.5925 + 0.02=0.2780 }$.
• Counter-Example(s):
• See: Artificial Neural Network, Perceptron.

## References

### 2018

• (CS231n, 2018) ⇒ Commonly used activation functions. In: CS231n Convolutional Neural Networks for Visual Recognition Retrieved: 2018-01-14.
• QUOTE: Sigmoid. The sigmoid non-linearity has the mathematical form $\displaystyle{ \sigma(x)=1/(1+e^{−x}) }$ and is shown in the image above on the left. As alluded to in the previous section, it takes a real-valued number and “squashes” it into range between 0 and 1. In particular, large negative numbers become 0 and large positive numbers become 1. The sigmoid function has seen frequent use historically since it has a nice interpretation as the firing rate of a neuron: from not firing at all (0) to fully-saturated firing at an assumed maximum frequency (1). In practice, the sigmoid non-linearity has recently fallen out of favor and it is rarely ever used. It has two major drawbacks:
• Sigmoids saturate and kill gradients. A very undesirable property of the sigmoid neuron is that when the neuron’s activation saturates at either tail of 0 or 1, the gradient at these regions is almost zero. Recall that during backpropagation, this (local) gradient will be multiplied to the gradient of this gate’s output for the whole objective. Therefore, if the local gradient is very small, it will effectively “kill” the gradient and almost no signal will flow through the neuron to its weights and recursively to its data. Additionally, one must pay extra caution when initializing the weights of sigmoid neurons to prevent saturation. For example, if the initial weights are too large then most neurons would become saturated and the network will barely learn.
• Sigmoid outputs are not zero-centered. This is undesirable since neurons in later layers of processing in a Neural Network (more on this soon) would be receiving data that is not zero-centered. This has implications on the dynamics during gradient descent, because if the data coming into a neuron is always positive (e.g. $\displaystyle{ x gt 0 }$ elementwise in $\displaystyle{ f=wTx+b }$), then the gradient on the weights $\displaystyle{ w }$ will during backpropagation become either all be positive, or all negative (depending on the gradient of the whole expression $\displaystyle{ f }$). This could introduce undesirable zig-zagging dynamics in the gradient updates for the weights. However, notice that once these gradients are added up across a batch of data the final update for the weights can have variable signs, somewhat mitigating this issue. Therefore, this is an inconvenience but it has less severe consequences compared to the saturated activation problem above.