Multi Hidden Layer Support (another proposal)#107
Open
maksuel wants to merge 16 commits intoCodingTrain:masterfrom
Open
Multi Hidden Layer Support (another proposal)#107maksuel wants to merge 16 commits intoCodingTrain:masterfrom
maksuel wants to merge 16 commits intoCodingTrain:masterfrom
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.
Collaborator
|
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. |
Author
|
Vesatilus, I was looking for a more semantic way to store the variables. That was the beginning of code refactoring. |
Versatilus
reviewed
Apr 15, 2018
lib/nn.js
Outdated
| function mutate(val) { | ||
| if (Math.random() < rate) { | ||
|
|
||
| if(Number(rate) !== rate || (0 < rate && rate < 1)) { |
Collaborator
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
/**
*/