Comments (10)
@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.
@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.
from brain.js.
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.
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.
@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.
@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.
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.
Strange, I did think what NN work just with multiply, but sum.. I don't think it easy task for NN
from brain.js.
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)
- Deno Support?
- The Recurrent class will not function without a GPU HOT 1
- Unable to install Brain.js on PopOS HOT 22
- GPU powered AI demo is a 404 HOT 2
- "Forecasting" demo is a 404 HOT 2
- tree process
- Freezing when training NeuralNetworkGPU (async).
- Train with NeuralNetworkGPU more slower than CPU HOT 3
- Always the same output data on NeuralNetwork HOT 1
- Unable to install on MacOS Ventura HOT 1
- Did you try the built in distance calc?
- need to update URL for example
- MacOS node 20.10.0 build failing HOT 2
- Fatal error while installing via NPM package HOT 1
- Most example links are broken HOT 4
- Summary()
- Type 'InputType' is not assignable to type 'Partial<INumberHash>'... and many others
- stream-example.js page not found error HOT 1
- Npm i brain.js || node-gyp error
- Brain.js to detect bad words HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brain.js.