Created
December 7, 2017 09:15
-
-
Save jasper-lyons/0ea9924b0736468a9b804963a8618d83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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