photopea/UNN.js

Random outputs (predictions)

render2020 opened this issue · 3 comments

Hi,

Sadly your script doesn't seems to be consistence in output (prediction).
Just run it few times (press F5 refresh Chrome console and you will see different results).
Every aprox. 5+ time it's random, not stable, doesn't matter how many iterations while training.

Run it yourself.
`

<script type="text/javascript" src="/js/UNN.js"></script> <script type="text/javascript" src="/js/UNN.util.js"></script> <script> var net = UNN.Create([ ["inpt","line",2,1,1], ["full","sigm",2,1,1], ["full","sigm",1,1,1] ], 0.5); var O = []; var In = [[0,0],[0,1],[1,0],[1,1]], Ou = [[0],[1],[1],[0]]; var prm = { method:"sgd", batch_size:1 }; for(var i=0; i< 50000; i++){ UNN.Train(net,In,Ou,prm); } UNN.GetOutput(net, [0,0], O); console.log(O[2][0]); //should be aprox 0.0xxxx UNN.GetOutput(net, [1,0], O); console.log(O[2][0]); // should be aprox 0.9xxxx UNN.GetOutput(net, [0,1], O); console.log(O[2][0]); // should be aprox 0.9xxxx </script>`

FIREFOX:
image

CHROME:
image
image
image
image

IE EDGE
image
image
image

Hi, I am aware of this. The back-propagation method is not guaranteed to reach a certain error level all the time. It is not a problem of UNN.js, but the same thing happens in any implementation of back-propagation learning.

You could improve it by trying different initial weights, , different learning method ("adadelta" instead of "sgd") or a different learning rate. Even the order of the training inputs is important.

If training the same network is more stable in another program, it is probably you are using different parameters (or their default parameters are different than ours). But for some other cases, our parameters could work better.

Hi again

Thank you for your extensive explanation, I see
It's my lack of knowledge
I will try again and report.
Have good day and stay safe from Covid.
👌

Hi again

Thank you for your extensive explanation, I see It's my lack of knowledge I will try again and report. Have good day and stay safe from Covid. ok_hand

get good kid LMAOOOOOOOPOOOOOOO