*657*

When building a neural network, relu activation function you can choose which Activation Function to use in the hidden layer and the output layer.

This article talks about a few of the options relu activation function.

## About:

Artificial neural networks relu activation function based on the biological neurons in the human body, which become active in certain situations and cause the body to do something related. Artificial neural nets are made up of many layers of artificial neurons that are connected and powered by activation functions that turn them ON and OFF. In the training phase, neural nets learn certain values, just like traditional machine learning algorithms.

The ReLU’s behavior changes abruptly at 0, while the sigmoid’s behavior changes gradually. Both curves tend to 0 when x is small, but the sigmoid curve tends to 1 when x is big.

The action potential in neuroscience is the source of the activation function in computer science. If the difference in electrical potential between the inside and outside of a neuron is higher than a value called the action potential, the neuron goes through a chain reaction that lets it “fire” and sends a message to nearby neurons. This chain of activations called a “spike train” lets sensory neurons send information from the fingers to the brain about what they feel and lets motor neurons send instructions from the brain to the limbs.

## Brief Overview of Neural Networks

Artificial Neural Networks are a lot like the human brain in that they are made up of different layers that each does a certain job. Each layer has a different number of neurons, which are like the neurons in the human body. These neurons become active in certain situations, which causes the body to do something similar in response to a stimulus. These neurons are connected to different layers through activation functions.

Forward propagation is the process by which information moves from one layer to the next, from the input layer to the output layer. Once the output variable is known, the loss function can be worked out. With the help of an optimizer, back-propagation is used to change the weights and lower the loss function. The most common optimizer algorithm is gradient descent. Several epochs are run until the loss gets closer and closer to the global minimum.

## What is the function of activation?

The activation function is a simple mathematical function that takes an input and turns it into a range of outputs. From their name, they activate the neuron when the output reaches the set threshold value of the function. Their job is to turn the neuron on and off. The neuron receives the sum of the product of inputs and randomly initialized weights along with a static bias for each layer. Activation functions add nonlinearity to the network so that it can learn complex patterns in the data, like images, text, videos, or sounds. If our model doesn’t have an activation function, it will act like a linear regression model, which can only learn so much.

If we want to make all of these brain functions happen artificially, we can use an Artificial Neural Network. In this type of network, we take a single node (which is a copy of a neuron) and split it into two more parts. The first part is called the Summation, and the second part is called the Activation Function.

## Just what is ReLU?

The rectified linear activation function, or ReLU, is a nonlinear or piecewise linear function that will directly output the input if it is positive and will output zero if it is negative.

It is the most common activation function in neural networks, especially in Convolutional Neural Networks (CNNs) and Multilayer perceptrons.

Now, we’ll test our function by giving it some input values and plotting the result with the plot from the matplotlib library. From -5 to 10, you can put in a number. On this set of input values, we use the function we’ve already defined.

Note that we gave it a set of numbers that all went up, so the output is a straight line with an increasing slope.

## Why doesn’t ReLU go in order?

At first, glance, when ReLU is plotted, it looks like a straight line. But in reality, it is a nonlinear function that is needed to learn complex relationships from the training data.

When the value is positive, it works as a linear function, and when the value is negative, it works as a non-linear activation function.

When we use an optimizer like SGD (Stochastic Gradient Descent) during backpropagation, it acts like a linear function for positive values. This makes it much easier to figure out the gradient. This near-linearity lets properties stay the same and make it easy to use gradient-based algorithms to improve linear models.

Also, ReLU makes weighted sum more sensitive, which keeps neurons from becoming overloaded (i.e when there is little or no variation in the output).

slope of ReLU is 1 when the value is positive and 0 when the value is negative.

## What’s good about ReLU:

The network is backpropagating, the “Vanishing Gradient” stops important information from getting to the earlier layers. Also, the Sigmoid and Tanh become less sensitive and “saturate.”

## Some of the things that ReLU does well are:

Simpler computation: the derivative stays the same, or 1 when the input is positive. This shortens the time it takes for the model to learn and reduces errors.

Representational Sparsity: It can give a true zero as an output.

Linearity: Activation functions that work in a straight line are easier to optimize and make the flow smoother.

## Disadvantages of ReLU:

Exploding Gradient: This happens when the gradient gets bigger and bigger, which makes the next weight updates very different. This leads to instability when moving toward the global minimum, and it also leads to instability when learning.

A gradient of 0 is also 0, it’s not likely that the neuron will ever get better. This happens when the rate of learning is too fast or when there is a lot of negative bias.

For example, if the first neuron signal is x1 and their weight is 1, then the first neuron signal would be x1 1. In the same way, we’ll figure out the values of the second neuron, the third neuron, and so on. We will finally take some of all the neurons.

**CONCLUSIONS**

With this Open Genus article, you should know everything there is to know about the relu activation function, ReLU is the (Rectified Linear Unit) Activation Function.