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

Add simple NN test #66

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add simple NN test #66

wants to merge 2 commits into from

Conversation

arisanguinetti
Copy link
Contributor

I'm a noobie on testing, not even sure if what I made is correct. I've created a random NN and saved the initial status. then trained the NN 100 times and compared the output with a stored target NN. I think this was mentioned in issue #53 by @shiffman

@GhostRabbit
Copy link

Tests of nn.js is desperatly needed but I fear that running a network for 100 iterations can quickly result in the smell of slow tests. But slow tests are better then no tests!

let nn = NeuralNetwork.deserialize(defaultNN);

for (let i = 0; i < (training_data.length * 100); i++) {
let index = i % training_data.length;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should randomize the index to train the NN better probably like :-
let index = Math.random() * training_data.length | 0;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants