Skip to content

Instantly share code, notes, and snippets.

@mattfawcett
Created January 4, 2011 15:32
Show Gist options
  • Save mattfawcett/764917 to your computer and use it in GitHub Desktop.
Save mattfawcett/764917 to your computer and use it in GitHub Desktop.
require "rubygems"
require "ai4r"
net = Ai4r::NeuralNetwork::Backpropagation.new([3, 2])
1000.times do
net.train([1,3,5], [1,0])
net.train([1,3,4], [1,0])
net.train([3,4,5], [1,0])
net.train([5,4,2], [0,1])
net.train([4,1,1], [0,1])
end
puts net.eval([5,2,1]).inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment