Machine learning with Tensorflow — add hidden network

From previous post Simple neural network, we’ve built our first neural network and got okay result. There are few ways to improve it. This time we’ll see if adding hidden layer to the model would increase accuracy.

Very first thing we can try is to add more layers in our network. By adding more neurons, helps to train on more complex patters.

We’ll add hidden neurons with activation function relu , this additional layers are not directly connected to input and output layer, thus it’s considered as hidden. Output has 10 neurons and each neurons are activated when certain digit was recognised.

Our previous model achieved 92% of train accuracy, 92% of validation accuracy and 91% test accuracy. With adding new hidden layers, 99.97% of train accuracy, 97.51% of validation accuracy and 97.6% test accuracy.

Accuracy / epoch
Loss / epoch

This is already pretty good improvements by just adding two hidden layers, however as graphs show, after certain epochs we can’t really see improvements. Also validation loss has increased after ~150epoch.

We can try to improve this model by adding or removing hidden layer.

In the next post we’ll try to improve our model with dropout.

Data science enthusiast. Into algorithmic trading. https://github.com/Naolin