Skip to content
This repository has been archived by the owner on Feb 28, 2018. It is now read-only.

Sometimes not working properly #21

Open
yovanoc opened this issue Oct 13, 2017 · 0 comments
Open

Sometimes not working properly #21

yovanoc opened this issue Oct 13, 2017 · 0 comments

Comments

@yovanoc
Copy link

yovanoc commented Oct 13, 2017

I don't know why but sometimes (often) the outputs values seems weird, for this simple sketch:


function setup() {
  createCanvas(800, 600)

  // Creating a Neural Network with # of inputs, hidden neurons, and outputs
  nn = new NeuralNetwork(2, 4, 1);
  // Training the Neural Network with inputs and known outputs
  for (var i = 0; i < 20000; i++)
  {
  	nn.train([0,0], [0]);
  	nn.train([0,1], [1]);
  	nn.train([1,0], [1]);
  	nn.train([1,1], [0]);
  }

  console.log(nn.query([0,0]));
  console.log(nn.query([0,1]));
  console.log(nn.query([1,0]));
  console.log(nn.query([1,1]));
}

function draw() {
  background(51)
}

I obtain something like this (sometimes, often):

[0.014234893059839713] [0.9856006837596043] [0.4997097129483589] [0.5001547703319872]

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

No branches or pull requests

1 participant