future of ai on the jvm

30
Future of AI on the JVM Scala Days Amsterdam 2015 Adam Gibson Creator of Deeplearning4j (and 4s :)

Upload: adam-gibson

Post on 21-Apr-2017

11.650 views

Category:

Data & Analytics


0 download

TRANSCRIPT

Page 1: Future of ai on the jvm

Future of AI on the JVM

Scala Days Amsterdam 2015

Adam Gibson Creator of Deeplearning4j (and 4s :)

Page 2: Future of ai on the jvm

What is AI?● Not Terminator (despite our name)● Many subfields● Our focus: Machine learning

Page 3: Future of ai on the jvm

Big Data?

Page 4: Future of ai on the jvm

Problem Space● Spam Classification● Summarization● Face Detection● Eye Tracking● Targeted Ads● Recommendation Engines

Page 5: Future of ai on the jvm

Current State of ML● Simpler models● Most of industry barely uses Logistic Reg.● Many problems are binary

o e.g. fraud, spam● Some unsupervised (clustering, reccos)● Lots of ML frameworks on JVM

Page 6: Future of ai on the jvm

ML Frameworks on JVM...● Apache Mahout● Spark’s MLlib● Weka (is that R?)

Page 7: Future of ai on the jvm

ML GUIs● Prediction.io● Encog

Page 8: Future of ai on the jvm

Problems● Monolithic● Makes assumptions about data● Hard to use ● No separation of concerns

Page 9: Future of ai on the jvm

Ring a Bell?● We call that “Monolithic”● Separate ML concerns:

Data Pipelines/VectorizationScoringModel TrainingEvaluation

Page 10: Future of ai on the jvm

Micro-Services + ML?● Kinda like micro-services● Reduce lock in● Take math, data cleaning, model training,

choosing algorithms ...● … and separate them

Page 11: Future of ai on the jvm

Math● Parametric Models (Matrices!)● Non Parametric (Random forest)● Focusing on Matrices (the hard part of ML

systems)

Page 12: Future of ai on the jvm

Matrices● NDArrays ( > 2d)● Tensors (think of pages of matrices)● Example: 2 x 2 x 2 (2 2x 2 matrices)● ^^THIS IS UNCLEAR. Two 2 x 2 matrices?● Applies to graphs w/ sparse representations

Page 13: Future of ai on the jvm

Chips/Hardware/Matrices● CPUs - We work with these● GPUs - CUDA ditto● FPGAs

o Intel bought Altera, an FPGA maker, for $17 billion this month

o The edge, the cloud

Page 14: Future of ai on the jvm

Why New Chips?

Page 15: Future of ai on the jvm

Why New Chips?● See the numbers yourself:● http://www.slideshare.net/airbots/cuda-2933

0283● http://devblogs.nvidia.com/parallelforall/bidm

ach-machine-learning-limit-gpus/● http://jcuda.org

Page 16: Future of ai on the jvm

Mixed clusters● GPUs aren’t good for all workloads● Because latency● Need to upload data: not good for small

problems● Mixed CPU/GPU clusters are best bet

Page 17: Future of ai on the jvm

Data Pipelines● More data will be binary● Frameworks today can’t process binary well● Binary data has different semantics ● Moving windows for audio● 3d for images ...

Page 18: Future of ai on the jvm

People Roll Their Own b/c● Current frameworks assume clean data :(● Pipelines are brittle, hard to maintain

● Moving towards being composable (reuse)

Page 19: Future of ai on the jvm

Dedicated Libraries● Let’s focus on vectorization -- now!● Because IoT● Because more access to raw media

● Should fit into current big data frameworks

Page 20: Future of ai on the jvm

Scoring● AUC● F1● Different Loss Functions● Hyper parameter optimization

Page 21: Future of ai on the jvm

All independent● These things work for different models● Shouldn’t be tied to a particular system● Should be embeddable

Page 22: Future of ai on the jvm

Training● Split Train/Test● Sample data (no, not all the data ;) to

validate model● Increasingly compute intensive

Page 23: Future of ai on the jvm

Deep Learning● Most done in Python...● Norm training time is measured in

hours/days -- weeks!?● Work being done in HPC (Model parallelism)● Distbelief (Data parallelism)

Page 24: Future of ai on the jvm

Automatic Learning● Good at unstructured data● Images, Text, Audio and Sensors● Quick, baseline feature engineering

● Not good at feature introspection

Page 25: Future of ai on the jvm

Or are they?

Page 26: Future of ai on the jvm

TSNE

Page 27: Future of ai on the jvm

Where Does Scala Fit In?● Akka - Real time streaming analytics/micro services● Spark - Dataframes/number crunching● JVM Key/Value Stores● Pistachio (powers Yahoo’s ad network)

o http://yahooeng.tumblr.com/post/118860853846/distributed-word2vec-on-top-of-pistachio

Page 28: Future of ai on the jvm

The Way We Learn Now● Monolithic ML frameworks● No per-chip optimizations● No Tensors (come on guys, it’s 2015...)● Need isolation and less lockin● JVM is the platform to make it happen

Page 29: Future of ai on the jvm

Other Links● http://deeplearning4j.org/● http://nd4j.org/● https://github.com/deeplearning4j/Canova

Page 30: Future of ai on the jvm

Questions?● [email protected]● @agibsonccc● github.com/agibsonccc