tensorflow ruby

40
TENSORFLOW.RB TENSORFLOW AND RUBY by Jason Toy

Upload: jtoy

Post on 12-Jan-2017

636 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Tensorflow ruby

TENSORFLOW.RB TENSORFLOW AND RUBY

by Jason Toy

Page 2: Tensorflow ruby

PRESENTATION

machine learning

deep learning

tensors

tensorflow

tensorflow.rb

Page 3: Tensorflow ruby

MY BACKGROUND - JASON TOY

my passion is general artificial intelligence - studied math and computer science

generalists, program a little of everything, master of nothing

ruby and rails since 2005; machine learning since 2008

founded a couple of companies: rubynow, socmetrics - using ML and ruby

CEO of filepicker; not much ruby

exploring the intersection of machine learning,art, entrepreneurship

Page 4: Tensorflow ruby

REGRESSION

Page 5: Tensorflow ruby

CLASSIFIER

Page 6: Tensorflow ruby

OTHER ML PROBLEMS

search/ranking

reinforcement learning / realtime learning

dimensionality reduction

grouping/clustering

generative models

Page 7: Tensorflow ruby

TRADITIONAL ML ALGORITHMS

naive bayes

LDA

decision trees

ensemble methods

KNN

SVM

random forest

linear/logistic regression

PCA

Page 8: Tensorflow ruby

DEEP LEARNING VS TRADITIONAL MACHINE LEARNING

mostly automated feature extraction

Page 9: Tensorflow ruby

DEEP LEARNING VS TRADITIONAL MACHINE LEARNING

much better at learning nonlinear relationships

Page 10: Tensorflow ruby

DEEP LEARNING NEURONS

Page 11: Tensorflow ruby

DEEP LEARNING ALGORITHMS

Page 12: Tensorflow ruby

DEEP LEARNING ARCHITECTS

Page 13: Tensorflow ruby

GENERATIVE DEEP MODELStweak-able output w/ tensors

Page 14: Tensorflow ruby

DEEP DREAMING / INCEPTION

Page 15: Tensorflow ruby

]?{;./ΠK;

Page 16: Tensorflow ruby

I ACCIDENTALLY GAVE THE ANIMAL BACK OF MY HEAD , BREATHING DEEPLY . THERE WAS NO DOUBT IN HER EYES , AND I COULD TELL BY THE LOOK ON HIS FACE THAT HE DID N'T APPROVE OF WHAT WAS HAPPENING TO ME . IN FACT , IT MUST HAVE BEEN ONE OF THOSE RARE OCCASIONS , AS WELL AS A PET ANIMAL . HER SCENT FILLED THE AIR . THAT 'S WHAT SHE WAS LOOKING FOR , AND NOW SHE HAD TO STAY AWAKE LONG ENOUGH TO DIG UP THE LEASH

Page 17: Tensorflow ruby

TENSORFLOW AND TENSORS

Page 18: Tensorflow ruby

TENSORS

[ 1.000e+00 ,2.000e+00, 3.000e+00, 4.000e+00, 5.000e+00, 6.000e+00, 7.000e+00 ] #1st order tensor

[[1,123,323,21312,312312],[2,32,12313,123]] #2nd order tensor

nth order tensors

Page 19: Tensorflow ruby

TENSORFLOW IS AN OPEN SOURCE SOFTWARE LIBRARY FOR NUMERICAL COMPUTATION USING DATA FLOW GRAPHS

Page 20: Tensorflow ruby

TENSORFLOW HISTORY

2nd generation at Google

initial release

predecessors

~5 releases

slow….getting faster

many research firms groups using it. DeepMind just moved to it

Page 21: Tensorflow ruby

HIGHLEVEL GOALS

simple / works out of the box

GPU / CPU

easy deploy

write once, deploy everywhere

distributed training

Page 22: Tensorflow ruby

TENSORFLOW INTERNALS

DAG

typed: ints, multiple floating points, strings, etc

symbolic

client/master sessions

automatic gradient computation

Page 23: Tensorflow ruby

TENSORFLOW DATAFLOW

Page 24: Tensorflow ruby

TENSORFLOW OPERATIONS

Page 25: Tensorflow ruby

TENSORFLOW.RB

Page 26: Tensorflow ruby

PEOPLE WANT IT

https://github.com/tensorflow/tensorflow/issues/50

70+ comments; 40+ followers

Page 27: Tensorflow ruby

WHY RUBY

ruby community are innovative and creative

ruby,rails, gems,sequel,eventmachine,nokogiri,……

chance for the ruby community to enter the ML/DL era

Page 28: Tensorflow ruby

MACHINE LEARNING AND RUBY NOW

results = `python model_inference.py #{safe_params}`

results = RestClient.get(“http://somatic.io/model/call”,params)

Page 29: Tensorflow ruby

TENSORFLOW + SWIG

Page 30: Tensorflow ruby

SWIG

SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.

20+ languages

ruby SWIG projects: libSVM, liblinear, any big ones?

Page 31: Tensorflow ruby

HTTPS://GITHUB.COM/SOMATICIO/TENSORFLOW.RB

Page 32: Tensorflow ruby

GET STARTED

Page 33: Tensorflow ruby

TENSORFLOW.RB

Page 34: Tensorflow ruby

TENSORFLOW.RB

Page 35: Tensorflow ruby
Page 36: Tensorflow ruby

CURRENT STATUS

2-3 months away from stable

port more code

need help with protocol buffers

more tutorials

clean up API to match tensorflowISMs and rubyISMs

more tests

Page 37: Tensorflow ruby

LOOKING FOR CONTRIBUTORS

open source! BSD licensed (Tensorflow is Apache licensed)

6 contributors now

great way to do a deep dive into deep learning :)

learn tensorflow internals

Page 38: Tensorflow ruby

LOOKING FOR CONTRIBUTORS

Page 39: Tensorflow ruby

SPECIAL THANKS

sciruby

Arafat Khan

somatic.io

Khor SoonHin

Sameer Deskmukh

all other contributors

Page 40: Tensorflow ruby

–John Dewey

“Every great advance in science has issued from a new audacity of imagination.”

code: https://github.com/somaticio/tensorflow.rbJason Toy

[email protected]://somatic.io

@jtoy

QUESTIONS?