Neural network is not giving the expected output after training in Python
It looks like your loss is improving (the loss is decreasing every epoch), so I wouldn't say the network isn't training. Try looking at a training plot (which would have epoch on the x-axis and loss on the y-axis). See if there are any jumps or strange patterns in the training. If you don't see a roughly decreasing training loss, then you have a problem. 

It's also possible that this model is just completely overfitting your data, leading to poor prediction on the test set. How many inputs do you have? Why are you using three hidden layers? Try reducing the size of your model and see if your prediction improves.