Smallest Neural Network for Complete Beginners in 4 Mins

Source: Deep Learning on Medium

Training the Network

In the beginning, neural net’s weights are initialized randomly. As we keep training the network the weights are updated. Let’s check the weight before we start training.

Now let’s fit the data in the network. Fitting is nothing but another name for training.

We have trained the network. As you can see in the progress bar, the network is trained on 100K samples. Now let’s feed a value to the network and check the response.

Network almost did the task. the output is very close to the input number and with the opposite sign. As we will train it on more data the output would get as closer to the target value. Also, let’s check the value of the weight now.

As we trained the network on the data, the weight changed from 0.42 to around -1. Which is obvious, since a number has to be multiplied by -1 in order to change its sign.