cazala / synaptic

architecture-free neural network library for node.js and the browser
http://caza.la/synaptic
Other
6.91k stars 666 forks source link

To the output is always 1. #277

Open antonhauff opened 6 years ago

antonhauff commented 6 years ago

Hi. Sorry for the stupid question. Two input neurons (0,1 or 0,0). And one output neuron (0 or 1). My task is to teach the network to calculate what will be the inputs (0,0 or 0,1) to the output is always 1.

How can I implement my task?

FM-96 commented 6 years ago

To be honest, I have no idea what you're trying to do.

But did you look at the wiki page? How to train your network is described there.

bashz commented 6 years ago

I am not sure I'v understood the question, so I am presuming that you want to implement this :

var myNetwork = new Architect.Perceptron(2, 1)
var trainer = new Trainer(myNetwork)

var trainingSet = [
  {
    input: [0,0],
    output: [1]
  },
  {
    input: [0,1],
    output: [1]
  }
]
trainer.train(trainingSet);
ghost commented 6 years ago

Also add training data for what to be if you have 0.5 and 0.5 as input. Otherwise there is nothing to learn lol

LuKks commented 6 years ago

Maybe the way to create the architecture it's a problem too (one parameter it's was missing): new Architect.Perceptron(2, 2, 1); //2 inputs, 1 hidden layer with 2 neurons and 1 output.

Just read this and you got it: https://github.com/cazala/synaptic/wiki/Trainer