brain.retro.js icon indicating copy to clipboard operation
brain.retro.js copied to clipboard

empty object out of retro()

Open robertleeplummerjr opened this issue 8 years ago • 3 comments

Started here: https://github.com/harthur-org/brain.js/issues/5#issuecomment-274994616

robertleeplummerjr avatar Jan 25 '17 02:01 robertleeplummerjr

Following up from the linked issue, input data as an array of numbers seems to break the retro() function.

var net = new brain.NeuralNetwork();

      net.train([
        {input: [0, 0], output: [0]},
        {input: [0, 1], output: [1]},
        {input: [1, 0], output: [1]},
        {input: [1, 1], output: [0]}
      ]);

      var output = net.run([1, 0]);
      console.log('out', output);// [0.933]
      console.log('retro', retro(output, net));// {2: NaN}

jrobinson01 avatar Jan 25 '17 03:01 jrobinson01

oh nice, I see what you did there

robertleeplummerjr avatar Jan 25 '17 03:01 robertleeplummerjr

In addition, my real world output is more like:{isIt:1}

jrobinson01 avatar Jan 25 '17 03:01 jrobinson01