Future of ai on the jvm
-
Upload
adam-gibson -
Category
Data & Analytics
-
view
11.650 -
download
0
Transcript of Future of ai on the jvm
![Page 1: Future of ai on the jvm](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/1.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/2.jpg)
What is AI?● Not Terminator (despite our name)● Many subfields● Our focus: Machine learning
![Page 3: Future of ai on the jvm](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/3.jpg)
Big Data?
![Page 4: Future of ai on the jvm](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/4.jpg)
Problem Space● Spam Classification● Summarization● Face Detection● Eye Tracking● Targeted Ads● Recommendation Engines
![Page 5: Future of ai on the jvm](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/5.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/6.jpg)
ML Frameworks on JVM...● Apache Mahout● Spark’s MLlib● Weka (is that R?)
![Page 7: Future of ai on the jvm](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/7.jpg)
ML GUIs● Prediction.io● Encog
![Page 8: Future of ai on the jvm](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/8.jpg)
Problems● Monolithic● Makes assumptions about data● Hard to use ● No separation of concerns
![Page 9: Future of ai on the jvm](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/9.jpg)
Ring a Bell?● We call that “Monolithic”● Separate ML concerns:
Data Pipelines/VectorizationScoringModel TrainingEvaluation
![Page 10: Future of ai on the jvm](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/10.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/11.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/12.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/13.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/14.jpg)
Why New Chips?
![Page 15: Future of ai on the jvm](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/15.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/16.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/17.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/18.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/19.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/20.jpg)
Scoring● AUC● F1● Different Loss Functions● Hyper parameter optimization
![Page 21: Future of ai on the jvm](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/21.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/22.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/23.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/24.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/25.jpg)
Or are they?
![Page 26: Future of ai on the jvm](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/26.jpg)
TSNE
![Page 27: Future of ai on the jvm](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/27.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/28.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062503/58f9a97a760da3da068b6f0a/html5/thumbnails/29.jpg)
Other Links● http://deeplearning4j.org/● http://nd4j.org/● https://github.com/deeplearning4j/Canova