Original article was published on Deep Learning on Medium

There are many python libraries to build and train neural networks like Tensorflow and Keras. But to really understand neural networks, we need to understand its basic structure and be able to build and train a network of our own.

Neural networks can learn data much better compared to regular machine learning algorithms. In fact, *a neural network algorithm can be interpreted as a bunch of linear regressions*, where each node is an output of one linear regression.

In the diagram below, the input layer has 3 nodes and the next layer (hidden) has 4 nodes and the output layer has 2 nodes. The input layer is not counted in the number of layers, hence it is a 2-layered network.

Each node in the 2 layers are an output of one linear regression. At each layer, after the linear regressions are performed, the values are fed to an activation function.

The basic algorithm for a neural network should be something like this.

`for n epochs:`

1. forward_propagation() #predicting output

2. backward_propagation() #updating parameters according to loss

The function names suggest the basic structure of the algorithm. In this article, we will build a 2-layer neural network.

Let’s look at the common naming conventions we will be using.