Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numpy implemented model can not work #2

Closed
jasstionzyf opened this issue Oct 15, 2018 · 2 comments
Closed

numpy implemented model can not work #2

jasstionzyf opened this issue Oct 15, 2018 · 2 comments
Labels
invalid This doesn't seem right

Comments

@jasstionzyf
Copy link

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

@SkalskiP
Copy link
Owner

  1. 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.

  2. 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.

  3. 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?

@jasstionzyf
Copy link
Author

thanks for your reply! yes , you are right , i just though it is a ready demo program .
i have use your suggestions, it works!

@SkalskiP SkalskiP added the invalid This doesn't seem right label Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants