-
Notifications
You must be signed in to change notification settings - Fork 242
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
Multi Hidden Layer Support (another proposal) #107
base: master
Are you sure you want to change the base?
Conversation
Added "Rest parameters" for the future implementation of hidden multi-layers, where you will pass arguments like this: new NeuralNetwork(3,6,8,6,4) new NeuralNetwork(input, hidden_1, hidden_2, hidden_3..., output) Added "handle errors" in constructor method.
We would like to integrate something like this hopefully in the near future. Dan would like to do a little bit more in his streams with the simplified network first. I'm curious why you chose to store the weights in a separate array instead of storing them in the layer objects. |
Vesatilus, I was looking for a more semantic way to store the variables. That was the beginning of code refactoring. |
lib/nn.js
Outdated
function mutate(val) { | ||
if (Math.random() < rate) { | ||
|
||
if(Number(rate) !== rate || (0 < rate && rate < 1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be missing something here because I'm not fully awake yet, but aren't you missing a !
in there somewhere? Also, both 0
and 1
are viable, though pointless, values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Went unnoticed.
I refactoried the entire nn.js code.
NO CONFLICTS
Please, do not hesitate to improve!
Reference: #61
EXAMPLE: https://maksuel.github.io/Toy-Neural-Network-JS/examples/doodle_classification/
(the example use 2 hidden layers)
/**
*/