Dōmo arigatō, Mr. Roboto:
Machine Learning with Ruby
# Eric Weinstein
# RubyConf 2016
# Cincinnati, Ohio
# 10 November 2016
Slide 2
Slide 2 text
for Joshua
Slide 3
Slide 3 text
Part 0: Hello!
Slide 4
Slide 4 text
About Me
eric_weinstein = {
employer: 'Hulu',
github: 'ericqweinstein',
twitter: 'ericqweinstein',
website: 'ericweinste.in'
}
30% off with RUBYCONF30!
Slide 5
Slide 5 text
Agenda
• What is machine learning?
• What is supervised learning?
• What’s a neural network?
• Machine learning with Ruby and the MNIST
dataset
Slide 6
Slide 6 text
Part 1: Machine Learning
Slide 7
Slide 7 text
No content
Slide 8
Slide 8 text
What’s machine learning?
Slide 9
Slide 9 text
In a word:
Slide 10
Slide 10 text
Generalization
Slide 11
Slide 11 text
What’s Supervised Learning?
Classification or regression, generalizing from
labeled data to unlabeled data
Slide 12
Slide 12 text
Features && Labels
• Raw pixel features (vectors of intensities)
• Digit (0..9)
Slide 13
Slide 13 text
Features && Labels
• Raw pixel features (vectors of intensities)
• Digit (0..9)
Back End
train = RubyFann::TrainData.new(inputs:
features, desired_outputs: labels)
fann = RubyFann::Standard.new(num_inputs: 576,
hidden_neurons: [300], num_outputs: 10)
fann.train_on_data(train, 1000, 10, 0.01)
Slide 26
Slide 26 text
STOP
#demotime
Slide 27
Slide 27 text
Summary
• Machine learning is generalization
• Supervised learning is labeled data ->
unlabeled data
• Neural networks are awesome
• You can do all this with Ruby!
Slide 28
Slide 28 text
Takeaways (TL;DPA)
• We can do machine learning with Ruby
• Contribute to tools like Ruby FANN
(github.com/tangledpath/ruby-fann) and sciruby
(http://sciruby.com/)
• Check it out: http://ruby-mnist.herokuapp.com/
• PRs welcome! github.com/ericqweinstein/ruby-
mnist
Slide 29
Slide 29 text
Thank You!
Slide 30
Slide 30 text
Questions?
eric_weinstein = {
employer: 'Hulu',
github: 'ericqweinstein',
twitter: 'ericqweinstein',
website: 'ericweinste.in'
}
30% off with RUBYCONF30!