dorkrawk / grey_matter

Grey Matter is a basic artificial neural network library for Crystal.
MIT License
9 stars 2 forks source link

question regarding output #2

Open bararchy opened 7 years ago

bararchy commented 7 years ago

So, I'm trying to train this data:

    # nn = (2, [5], 1)
    500.times do
      nn.train([1.0, 1.0], [1.0])
      nn.train([-1.0, -1.0], [-1.0])
      nn.train([1.0, -1.0], [-1.0])
      nn.train([-1.0, 1.0], [-1.0])
    end

Now, trying to test the trained net

puts nn.test([-1.0, -1.0])
=> [0.60850011830341011]
# What I expected
=> [-0.8] .. [-1.0]

Am I missing something ?

bararchy commented 7 years ago

Hm... seems like xor is failing in the specs too

  1) GreyMatter::NeuralNetwork #train converges on a reasonable solution to XOR
     Failure/Error: nn.evaluate([0,0]).first.should be_close(0, 0.01)

       Expected 0.65871374371335656 to be within 0.01 of 0
dorkrawk commented 7 years ago

So, this library is nowhere near complete. I would not try to use this at all right now. Backprop is still only partially implemented so I wouldn't expect anything to work at this time.