# Activation function and its effect on backpropagation

Last updated on：2 years ago

There some basic principles of an artificial neuron. The content is mostly about the review of class “Optimal theories and methods”.

# Artificial neuron

An artificial neuron is a mathematical function conceived as a model of biological neurons. An artificial neuron is elementary units in an artificial neural network.

The artificial neuron receives one or more inputs and sums them to produce an output.

# Components

Neural networks generally consist of five components:

- A directed graph is known as the network topography.
- A state variable associated with each neuron.
- A real-valued weight associated with each connection.
- A real-valued bias associated with each neuron.
- A transfer function $f$ for each neuron

where $i = 1,2,…,n$.

## Input and output

On the last image, $x_1, x_2, …, and x_m$ is input (some features), and $y_i$ is output.

## Weights

When $w*{ij}>0$ means activation, by contrast, $w*{ij}<0$ means deactivation. The values of weights can measure the degree of impact between nodes $i$ and $j$ in a different layer.

## Activation function/Transfer function

The activation function of a node defines the output of that node given an input or set of inputs. Only **nonlinear activation functions** allow such networks to compute nontrivial problems using only a small number of nodes, and such activation functions are called **nonlinearities**.

Utilizing nonlinear activation functions can avoid linear units can be simplified as one unit. Nonlinear activation function can also be used to solve non-linearly separable problems.

$\phi$ is the transfer function (commonly a threshold function).

### Logistic function

The logistic function is a classic activation function always used in **ANN**. There are **two types** of logistic function which are sigmoid function and hyperbolic tangent function (tanh).

#### Sigmoid function

The function is expressed as:

where $x=w_{ij}v_i+b_i$ and the slope parameter $a$.

Drawbacks:

**Vanishing gradient problem.**The gradient for the data fallen in the region of either 0 or 1 is almost zero. Data is not passed the neurons to the update the weights parameter during BP training.- The sigmoid activation function centre on 0.5. Thus, it slows down the learning process of the DNN.

#### tanh function

It is a rescaled and biased version of sigmoid function.

### Multistate activation function (MSAF)

MSAF combined with multiple logistic functions and a constant, $r_1$ to have additional output states.

### Rectified linear unit (ReLU) and leaky rectified linear unit (LReLU)

ReLU has become a default activation function in DNN because of its simplicity that shortens the training computational time.

Drawback:

- ReLU may not pre-defined boundary. Caused by the neuron that in the negative of the activation function that will no longer be activated throughout the training process.

LReLU can solve this problem.

### Exponential linear unit

ELU **reduces bias shift problem,** which is defined as the change of a neuron’s mean value due to weights update. ELU has negative values which allow them to push mean unit activations closer to 0 like batch normalization, but with lower computation complexity. Compared to LReLU, ELU has a clear saturation plateau in its negative region.

### SUMMARY OF ACTIVATION FUNCTION

## Activation backpropagation

**Sigmoid function**

**Softmax function**

**ReLu function**

**In general, calculating the softmax is slower than the sigmoid and calculating ReLu is faster.**

## Bias

A bias unit is meant to allow units in your net to learn an appropriate threshold (i.e. after reaching a certain total input, start sending positive activation), since normally a positive total input means a positive activation.

As a switch quantity to control activation function, expressed as $\theta_i$

# Reference

[2] Montana, D.J., 1995. Neural network weight selection using genetic algorithms. *Intelligent Hybrid Systems*, *8*(6), pp.12-19.

[4] Lau, M.M. and Lim, K.H., 2018, December. Review of adaptive activation function in deep neural network. In *2018 IEEE-EMBS Conference on Biomedical Engineering and Sciences (IECBES)* (pp. 686-690). IEEE.

[5] Rasamoelina, A.D., Adjailia, F. and Sinčák, P., 2020, January. A Review of Activation Function for Artificial Neural Network. In *2020 IEEE 18th World Symposium on Applied Machine Intelligence and Informatics (SAMI)* (pp. 281-286). IEEE.

[6] Why the BIAS is necessary in ANN? Should we have separate BIAS for each layer?

本博客所有文章除特别声明外，均采用 CC BY-SA 4.0 协议 ，转载请注明出处！