Skip to content

Instantly share code, notes, and snippets.

@jasper-lyons
Created December 7, 2017 09:15
Show Gist options
  • Save jasper-lyons/0ea9924b0736468a9b804963a8618d83 to your computer and use it in GitHub Desktop.
Save jasper-lyons/0ea9924b0736468a9b804963a8618d83 to your computer and use it in GitHub Desktop.
data = (-10...10).map { |n| [n, n * 5] }
weight = 0
30.times do
input, expected = data.sample # [[input, expected]]
output = weight * input
weight = weight - (expected - output)
puts([input, expected, output].inspect)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment