Tensorflow ruby

Preview:

Citation preview

TENSORFLOW.RB TENSORFLOW AND RUBY

by Jason Toy

PRESENTATION

machine learning

deep learning

tensors

tensorflow

tensorflow.rb

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

REGRESSION

CLASSIFIER

OTHER ML PROBLEMS

search/ranking

reinforcement learning / realtime learning

dimensionality reduction

grouping/clustering

generative models

TRADITIONAL ML ALGORITHMS

naive bayes

LDA

decision trees

ensemble methods

KNN

SVM

random forest

linear/logistic regression

PCA

DEEP LEARNING VS TRADITIONAL MACHINE LEARNING

mostly automated feature extraction

DEEP LEARNING VS TRADITIONAL MACHINE LEARNING

much better at learning nonlinear relationships

DEEP LEARNING NEURONS

DEEP LEARNING ALGORITHMS

DEEP LEARNING ARCHITECTS

GENERATIVE DEEP MODELStweak-able output w/ tensors

DEEP DREAMING / INCEPTION

]?{;./ΠK;

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

TENSORFLOW AND TENSORS

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

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

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

HIGHLEVEL GOALS

simple / works out of the box

GPU / CPU

easy deploy

write once, deploy everywhere

distributed training

TENSORFLOW INTERNALS

DAG

typed: ints, multiple floating points, strings, etc

symbolic

client/master sessions

automatic gradient computation

TENSORFLOW DATAFLOW

TENSORFLOW OPERATIONS

TENSORFLOW.RB

PEOPLE WANT IT

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

70+ comments; 40+ followers

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

MACHINE LEARNING AND RUBY NOW

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

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

TENSORFLOW + SWIG

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?

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

GET STARTED

TENSORFLOW.RB

TENSORFLOW.RB

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

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

LOOKING FOR CONTRIBUTORS

SPECIAL THANKS

sciruby

Arafat Khan

somatic.io

Khor SoonHin

Sameer Deskmukh

all other contributors

–John Dewey

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

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

jason@somatic.iohttp://somatic.io

@jtoy

QUESTIONS?

Recommended