Closed jasstionzyf closed 5 years ago
I am very sorry that you had to wait so long for an answer. I did not receive a notification that you reported the problem.
A few words of explanation at the beginning. The code in the notebook is the most basic version of the neural network. I mentioned this in my article. As a result, it may fall into certain traps, such as, for example, a disappearing gradient and so on... In order to deal with such problems, certain optimisation techniques are introduced. However, they are not included in this implementation. If you look in the logs by setting the verbose flag to true, you will see that the value of the cost function decreases. But it does it extremely slowly.
As to your problem. From what I see you have used a very small neural network.
nn_architecture = [ {"input_dim": 2, "output_dim": 4, "activation": "relu"}, {"input_dim": 4, "output_dim": 6, "activation": "relu"}, {"input_dim": 6, "output_dim": 6, "activation": "relu"}, {"input_dim": 6, "output_dim": 4, "activation": "relu"}, {"input_dim": 4, "output_dim": 1, "activation": "sigmoid"}, ]
Eventually, in my notebook I decided on such an architecture:
NN_ARCHITECTURE = [ {"input_dim": 2, "output_dim": 25, "activation": "relu"}, {"input_dim": 25, "output_dim": 50, "activation": "relu"}, {"input_dim": 50, "output_dim": 50, "activation": "relu"}, {"input_dim": 50, "output_dim": 25, "activation": "relu"}, {"input_dim": 25, "output_dim": 1, "activation": "sigmoid"}, ]
Please let me know if something has changed. Do you see an improvement?
thanks for your reply! yes , you are right , i just though it is a ready demo program .
i have use your suggestions, it works!
i copy all the necessary code from your provided Numpy deep neural network.ipynb ,
when i run the code ,Test set accuracy: 0.48 always keep 0.48. obviously this is not right