Skip to content

Instantly share code, notes, and snippets.

@irfansharif
Created April 20, 2016 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save irfansharif/6dfd0919e7c515f2a2a5e83509e23fce to your computer and use it in GitHub Desktop.
Save irfansharif/6dfd0919e7c515f2a2a5e83509e23fce to your computer and use it in GitHub Desktop.
@dataset = [
{ input: { a: 0, b: 0 }, output: { o: 0 } },
{ input: { a: 0, b: 1 }, output: { o: 1 } },
{ input: { a: 1, b: 0 }, output: { o: 1 } },
{ input: { a: 1, b: 1 }, output: { o: 0 } }
]
@network = Cerebrum.new
@network.train(@dataset)
actual_result = @network.run({a: 1, b: 0})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment