# What is Backpropagation in Machine Learning

Backpropagation is a key concept in machine learning, particularly in the training of neural networks. Furthermore, it’s an algorithm that calculates gradient of a loss function in order to optimize networks weights values.

In other words, once we pass data through the neural network from input to output, we propagate backwards, adjusting each weight value to optimize the performance of the network.

## Backpropagation in depth

It is an iterative process, where it adjusts weight values bit by bit. Furthermore, it takes advantage of a process we call gradient descent.

Each forward pass will give us a value from our loss function. More importantly we can use this value to determine how well our model performs at that point. We can do so by comparing what model calculates to what we want it to calculate.

Mind you, an efficient model will never reach 100% accuracy. But each percent above 90% will yield obvious change in results. In case your model does reach 100% accuracy, you may be dealing with overfitting.

If a model overfits on training data, it may perform perfectly on it. However, once it’ll be met with new example data, it can perform terribly.

### The backpropragation algorithm consists of several steps

- Forward propagation – during forward propagation, we feed input data into the network and let it calculate its final output, which entails calculation of a series of matrix multiplications and activation functions
- Error calculation – the algorithm calculates the error of the network by comparing what network spat out at the end to the desired results.
- Backward propagation – during this process the error propagates from output to input layer. Here, our algorithm calculates gradient of loss function with respect to each weight.
- Weight update – our algorithm slightly adjusts the weight values in the direction of the negative gradient by using an optimization algorithm such as gradient descent.

## Conclusion

To conclude, backpropagation is an essential part of training neural networks.

I hope this article helped you gain a better understanding of this process and perhaps even motivate you to learn even more about it.