Giter Site home page Giter Site logo

Accuracy about brain.js HOT 10 CLOSED

brandonros avatar brandonros commented on April 29, 2024
Accuracy

from brain.js.

Comments (10)

wagenaartje avatar wagenaartje commented on April 29, 2024 1

@brandonros, you cannot expect a neural network to map a function with such a small dataset - you have included just 5 training samples. Note that a neural network will always minimize the error on the given dataset, so you cannot guarantee that a neural network will perform as good on a a dataset that it was not trained on.

There are infinite possibilities for addition. So at least, scale your dataset up to 100 samples - you can do this dynamically by generating them. Split these 100 samples up in óne group of 80, and one group of 20.

Train the network on the 80 samples until it has reachted a low error. Then, test your neural network on the 20 samples on which it wasn't trained; if the error is low on those 20 samples, you know your neural network has successfully learned how to addition in some way or another.

from brain.js.

Dok11 avatar Dok11 commented on April 29, 2024

@brandonros your training data looks like random numbers. Maybe they dont have any dependecies between input and outup?
For example, second input key does not affect to result in the set. And one input to one output is... strange case.

from brain.js.

brandonros avatar brandonros commented on April 29, 2024

from brain.js.

Dok11 avatar Dok11 commented on April 29, 2024

error: 0.000099992701244754

Absolutely, your net remember just training data. In other words - overtrain.
Normal error will be between 0.3 — 0.02

from brain.js.

brandonros avatar brandonros commented on April 29, 2024

Absolutely, your net remember just training data. In other words - overtrain.
Normal error will be between 0.3 — 0.02

Can you share an example on how I could achieve what I am trying to achieve (neural network learns that it's simple addition) using the input I'm using? I've tried tweaking the error rate + not overtraining, but didn't get any better results.

from brain.js.

Dok11 avatar Dok11 commented on April 29, 2024

@brandonros as one of variants you can decrease purpose accuracy to some real data. Imagine what can somebody answer who have same dataset?
Really, I think what your data doesn't have any relationship. Or you need dramatically increase volume of trainig data as said @wagenaartje
So, set iterations less then 50, or get more training dataset.

from brain.js.

brandonros avatar brandonros commented on April 29, 2024

@wagenaartje Thank you for taking the time to respond. One question:

Would it ever make sense to train the model with the same data in reptition? Example:

var trainingSet = [];

for (var i = 0; i < 20; i++) {
  trainingSet.push({
    input: [0, 0],
    output: [0]
  });
}

for (var i = 0; i < 20; i++) {
  trainingSet.push({
    input: [0.1, 0.1],
    output: [0.2]
  });
}

for (var i = 0; i < 20; i++) {
  trainingSet.push({
    input: [0.2, 0.2],
    output: [0.4]
  });
}

console.log(feedForwardNet.train(trainingSet));

from brain.js.

brandonros avatar brandonros commented on April 29, 2024

@Dok11

Really, I think what your data doesn't have any relationship.

Sorry that I did not make it clear. The data should be representing addition. 0.1 + 0.1 = 0.2, etc.

from brain.js.

Dok11 avatar Dok11 commented on April 29, 2024

Strange, I did think what NN work just with multiply, but sum.. I don't think it easy task for NN

from brain.js.

robertleeplummerjr avatar robertleeplummerjr commented on April 29, 2024

The datset should be fine if you give it the loose principles of math, it just needs a good deal of them. Something I've tried that has worked nice is giving training results in every case from 0 to 10, for example. It depends what your ceiling is and your floor, but if it is a finite set you can give something general enough but specific to not get overfitting.

from brain.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.