Neural network output values over 1?
See original GitHub issueWhat is wrong?
after training on iris data https://archive.ics.uci.edu/ml/datasets/Iris/ output of one iris is massively higher than the others
How do we replicate the issue?
download the csv of data
const brain = require('brain.js');
const net = new brain.NeuralNetwork();
const fs = require('fs');
const data = fs.readFileSync('./iris.csv').toString();
const trainingData = data.split('\r\n').map((d) => {
const [slength, swidth, plength, pwidth, flower] = d.split(',');
return {
input: {
slength: slength / 10,
swidth: swidth / 10,
plength: plength / 10,
pwidth: pwidth / 10,
},
output: {
[flower]: 1,
},
};
});
const trainResults = net.train(trainingData);
console.log(trainResults);
const result = net.run({
slength: 0.51,
swidth: 0.35,
plength: 0.13999999999999999,
pwidth: 0.1 });
console.log(result);
How important is this (1-5)?
3
Expected behavior
{ 'Iris-setosa': 0.9973204731941223,
'Iris-versicolor': 0.003389077726751566,
'Iris-virginica': 2.462011443240403e-13 }
should be more like
{ 'Iris-setosa': 0.9973204731941223,
'Iris-versicolor': 0.003389077726751566,
'Iris-virginica': 0.003 }
Other Comments
training results
{ error: 0.008838672393814171, iterations: 20000 }
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Is it possible to get an output value greater than 1 (for ... - Quora
If you want the output greater than 1, you can set the activation function to give 0 till some threshold and after that...
Read more >Can Neural Networks Output Numbers > 1? - Stack Overflow
You can let the 0 and 1 represent binary positions of a numeric value. Say you have 10 output neurons, then you can...
Read more >Can I have a neural network output values >100?
The reason these networks output numbers between 0 and 1 is in the layer activations of the network.
Read more >Configuring a Neural Network Output Layer | Enthought, Inc.
This shows how a multi-label problem can identify more than one label for a given sample: by classifying instances that have a value...
Read more >Everything you need to know about Neural Networks and ...
Because of this properties it allows the nodes to take any values between 0 and 1. In the end, in case of multiple...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The other option you can go with is formatting the output as a string, such as using
.toFixed(14)
.Example:
It’s exponent values. An effort to make it more computationally easy and/or visually friendly. 13 zeros vs 2 zeros. Happens to the best of us.