SlideShare a Scribd company logo
1 of 22
Download to read offline
DL4J: Deep Learning for
the JVM and Enterprise
David C. Kale, Ruben Fiszel
Skymind
Workday Data Science Meetup
August 10, 2016
Who are we?
• Deeplearning4j: open source deep learning on the JVM
• Skymind: deep learning for enterprise
• fighting good fight vs. python deep learning mafia
• founded by Adam Gibson
• CEO Chris Nicholson
• Dave Kale: developer, Skymind: Scala API
• also PhD student, USC
• research: deep learning for healthcare
• Ruben Fiszel: intern, Skymind: reinforcement learning (RL4J)
• also MS student, EPFL
Outline
• Overview of deep learning
• Tour of DL4J
• Scaling up DL4J
• DL4J versus…
• Preview of DL4J Scala API
• Preview of RL4J
What is Deep Learning?
• Compositions of (deterministic) differentiable functions, some parameterized
• compute transformations of data
• eventually emit output
• can have multiple paths
• architecture is end-to-end differentiable w.r.t. parameters (w’s)
• training:
• define targets, loss function
• apply gradient methods: use chain rule to get component-wise updates
x1 f1(x1;w1) z1 f2(z1) z2
f3(z2;w3) y Loss(y,t)
t
f4(x2;w4)x2 z4
f3([z2,z4];
w3)
Example: multilayer perceptron
• Classic “neural net” architecture — a powerful nonlinear function approximator
• Zero or more fully connected (“dense”) layers of “neurons”
• ex. neuron: h = f(Wx + b) for some nonlinearity f (e.g., ReLu(a) = max(a, 0))
• Predict y from fixed-size, not-too-large x with no structure
• Classify digits in MNIST (digits are generally centered and upright)
• Model risk of mortality in patients with pneumonia
• Special case: logistic regression (zero hidden layers)
http://deeplearning4j.org/mnist-for-beginners
Variation of MLP: autoencoder
• “Unsupervised” training: no separate target y
• Learns to accurately reconstruct x from succinct latent z
• Probabilistic generative variants (e.g., deep belief net) can generate novel x’s by
first sampling z from prior probability distribution p(z)
http://deeplearning4j.org/deepautoencoder
Example: convolutional (neural) networks
• Convolution layers “filter” x to extract features
➡ Filters exploit (spatially) local regularities while preserving spatial relationships
• Subsampling (pooling) layers combine local information, reduce resolution
➡ pooling gives translational invariance (i.e., classifier robust to shifts in x)
• Predict y from x with local structure (e.g., images, short time series)
• 2D: classify images of, e.g., cats, cat may appear in different locations
• 1D: diagnose patients from lab time series, symptoms at different times
• Special case: fully convolutional network with no MLP at “top” (filter for variable-sized x’s)
http://deeplearning4j.org/convolutionalnets
63
CONVOLUTIONAL NET
Share the same parameters across
different locations:
Convolutions with learned kernels
Ranzato
(CVPR 2012 Tutorial, pt. 3 by M.A. Ranzato)
http://deeplearning.net/tutorial/lenet.html
Example: recurrent neural networks
• Recurrent connections between hidden units: ht+1 = f(Wx + Vht)
• Gives neural net a form of memory for capturing longterm dependencies
• More elaborate RNNs (LSTMs) learn when/what to remember or forget
• Predict y from sequential x (natural language, video, time series)
• Among most flexible and powerful learning algorithms available
• Also can be most challenging to train
http://deeplearning4j.org/recurrentnetwork
RNNs: flexible input-to-output modeling
• Diagnose patients from temporal data (Lipton/Kale, ICLR 2016)
• Predict next word or character (language modeling)
• Generate beer review from category, score (Strata NY talk)
• Translate from English to French (machine translation)
http://karpathy.github.io/2015/05/21/rnn-effectiveness/
Let’s get crazy with architectures
• How about automatically captioning videos?
• Recall: we are just composing functions that transform inputs
• Compose ConvNets with RNNs
• You can do this with DL4J today!
(Venugopalan, et al., NAACL 2015)
Machine learning in the deep learning era
• Architecture design + hyperparameter tuning replace iterative feature
engineering
• Easier to transfer “knowledge” across problems
• direct: can adapt generic image classifier into, e.g., tumor classifier
• indirect: analogies across problems point to architectures
• Often better able to leverage Big Data:
• start with high capacity neural net
• add regularization and tuning
• None of the following is true:
• your Big Data problems will all be solved magically
• the machines are going to take over
• the Singularity is right around the corner
DL4J architecture for image captioning
Shawn marries
Maya’s Mom. Mr.
Feeny officiates.
LSTM
MLP
Conv
Shawn marries Mr.
Feeny. Some lady is
there.
Loss
DL4J:
MultilayerNetwork
}DL4J: ConvolutionLayer
DL4J: Dense
DL4J: GravesLSTM
DL4J: RnnOutputLayer
DataVec: RecordReader
ND4J: LossFunction
DL4J:
OptimizationAlgorithm
Backpropagation
DL4J ecosystem for scalable DL
Arbiter
• Platform agnostic model evaluation
• Includes randomized grid search
Spark API
• Spark API wraps core DL4J classes
• Designing and configuring model
architecture identical
• Currently provides data parallelism
• Scales to massive datasets
• Accelerated, distributed training
• DataVec compatible with Spark RDDs
Core
• Efficient numpy-like numerical
framework (ND4J)
• ND4J backends for CUDA, ATLAS,
MKL, OpenBLAS
• Multi-GPU
Scalable DL with Spark API
• Use Downpour SGD model from (Dean, et al. NIPS 2012)
• Data parallelism
• training data sharded across workers
• workers each have complete model, train in parallel on disjoint minibatches
• Parameter averaging
• Master stores “canonical” model parameters
• Workers send parameter updates (gradients) to master
• Workers periodically ask for updated parameters from master
Example: LeNet image classifier
LeNet on github
Example: train LeNet on multi-GPU server
multi-GPU example on github
Example: distributed training of LeNet on Spark
Spark LeNet example on github
…
…
DL4J versus…
• For comparison of frameworks, see
• DL4J comparison page
• Karpathy lecture
• A zillion billion other blog posts and articles
DL4J versus…my two cents
• Using Java Big Data ecosystem (Hadoop, Spark, etc.): DL4J
• Want robust data preprocessing tools/pipelines: DL4J
• esp. natural language, images, video
• Custom layers, loss functions, etc.: Theano/TF + keras/lasagne
• grad student trying to publish NIPS papers
• trying to win Kaggle competition with OpenAI model from NIPS (keras)
• prototype an idea before implementing gradients by hand in DL4J
• Use published CV models from Caffe zoo: Caffe
• Python shop and don’t mind being hostage to Google Cloud: TF
• Good news: this is a false choice, like most things (see Scala API)
• Scala API for DL4J that emulates keras user experience
• Goal: reduce friction for going between keras and DL4J
• make it easy to mimic keras architectures
• load models keras-trained using common model format
(coming soon)
DL4J Scala API Preview
DL4J Scala API Keras
DL4J Scala API Preview
Thank you!
• DL4J: http://deeplearning4j.org/
• Skymind: https://skymind.io/
• Dave:
• email: dave@skymind.io
• Twitter: @davekale
• website: http://www-scf.usc.edu/~dkale
• MLHC Conference: http://mucmd.org
• Ruben
• email: ruben.fiszel@epfl.ch
• website: http://rubenfiszel.github.io/
Gibson	&	Patterson.	Deep	Learning:	A	
Practitioner’s	Approach.	O’Reilly,	Q2	2016.

More Related Content

What's hot

Scalable Machine Learning in R and Python with H2O
Scalable Machine Learning in R and Python with H2OScalable Machine Learning in R and Python with H2O
Scalable Machine Learning in R and Python with H2O
Sri Ambati
 
Solr + Hadoop = Big Data Search
Solr + Hadoop = Big Data SearchSolr + Hadoop = Big Data Search
Solr + Hadoop = Big Data Search
Mark Miller
 

What's hot (20)

DeepLearning4J and Spark: Successes and Challenges - François Garillot
DeepLearning4J and Spark: Successes and Challenges - François GarillotDeepLearning4J and Spark: Successes and Challenges - François Garillot
DeepLearning4J and Spark: Successes and Challenges - François Garillot
 
Hadoop Summit 2014 - San Jose - Introduction to Deep Learning on Hadoop
Hadoop Summit 2014 - San Jose - Introduction to Deep Learning on HadoopHadoop Summit 2014 - San Jose - Introduction to Deep Learning on Hadoop
Hadoop Summit 2014 - San Jose - Introduction to Deep Learning on Hadoop
 
Smart Data Conference: DL4J and DataVec
Smart Data Conference: DL4J and DataVecSmart Data Conference: DL4J and DataVec
Smart Data Conference: DL4J and DataVec
 
Deep Learning on Apache® Spark™ : Workflows and Best Practices
Deep Learning on Apache® Spark™ : Workflows and Best PracticesDeep Learning on Apache® Spark™ : Workflows and Best Practices
Deep Learning on Apache® Spark™ : Workflows and Best Practices
 
Snorkel: Dark Data and Machine Learning with Christopher Ré
Snorkel: Dark Data and Machine Learning with Christopher RéSnorkel: Dark Data and Machine Learning with Christopher Ré
Snorkel: Dark Data and Machine Learning with Christopher Ré
 
Hadoop summit 2016
Hadoop summit 2016Hadoop summit 2016
Hadoop summit 2016
 
High Performance Cloud Computing
High Performance Cloud ComputingHigh Performance Cloud Computing
High Performance Cloud Computing
 
New Developments in H2O: April 2017 Edition
New Developments in H2O: April 2017 EditionNew Developments in H2O: April 2017 Edition
New Developments in H2O: April 2017 Edition
 
Data science lifecycle with Apache Zeppelin
Data science lifecycle with Apache ZeppelinData science lifecycle with Apache Zeppelin
Data science lifecycle with Apache Zeppelin
 
Latest Developments in H2O
Latest Developments in H2OLatest Developments in H2O
Latest Developments in H2O
 
Neural Networks, Spark MLlib, Deep Learning
Neural Networks, Spark MLlib, Deep LearningNeural Networks, Spark MLlib, Deep Learning
Neural Networks, Spark MLlib, Deep Learning
 
Large Scale Graph Analytics with JanusGraph
Large Scale Graph Analytics with JanusGraphLarge Scale Graph Analytics with JanusGraph
Large Scale Graph Analytics with JanusGraph
 
Big Data Introduction - Solix empower
Big Data Introduction - Solix empowerBig Data Introduction - Solix empower
Big Data Introduction - Solix empower
 
Scalable Ensemble Machine Learning @ Harvard Health Policy Data Science Lab
Scalable Ensemble Machine Learning @ Harvard Health Policy Data Science LabScalable Ensemble Machine Learning @ Harvard Health Policy Data Science Lab
Scalable Ensemble Machine Learning @ Harvard Health Policy Data Science Lab
 
Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...
Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...
Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...
 
H2O with Erin LeDell at Portland R User Group
H2O with Erin LeDell at Portland R User GroupH2O with Erin LeDell at Portland R User Group
H2O with Erin LeDell at Portland R User Group
 
H2O Big Data Environments
H2O Big Data EnvironmentsH2O Big Data Environments
H2O Big Data Environments
 
Scalable Machine Learning in R and Python with H2O
Scalable Machine Learning in R and Python with H2OScalable Machine Learning in R and Python with H2O
Scalable Machine Learning in R and Python with H2O
 
Hambug R Meetup - Intro to H2O
Hambug R Meetup - Intro to H2OHambug R Meetup - Intro to H2O
Hambug R Meetup - Intro to H2O
 
Solr + Hadoop = Big Data Search
Solr + Hadoop = Big Data SearchSolr + Hadoop = Big Data Search
Solr + Hadoop = Big Data Search
 

Viewers also liked

Using browsing behavior history to predict user’s gender presenation
Using browsing behavior history to predict user’s gender   presenationUsing browsing behavior history to predict user’s gender   presenation
Using browsing behavior history to predict user’s gender presenation
晨揚 施
 
Accelerating Hadoop, Spark, and Memcached with HPC Technologies
Accelerating Hadoop, Spark, and Memcached with HPC TechnologiesAccelerating Hadoop, Spark, and Memcached with HPC Technologies
Accelerating Hadoop, Spark, and Memcached with HPC Technologies
inside-BigData.com
 
Support vector machine
Support vector machineSupport vector machine
Support vector machine
Musa Hawamdah
 

Viewers also liked (20)

DeepLearning4J and Spark: Successes and Challenges - François Garillot
DeepLearning4J and Spark: Successes and Challenges - François GarillotDeepLearning4J and Spark: Successes and Challenges - François Garillot
DeepLearning4J and Spark: Successes and Challenges - François Garillot
 
Deep Learning meetup
Deep Learning meetupDeep Learning meetup
Deep Learning meetup
 
Sf data mining_meetup
Sf data mining_meetupSf data mining_meetup
Sf data mining_meetup
 
Deep learning on a mixed cluster with deeplearning4j and spark
Deep learning on a mixed cluster with deeplearning4j and sparkDeep learning on a mixed cluster with deeplearning4j and spark
Deep learning on a mixed cluster with deeplearning4j and spark
 
Ersatz meetup - DeepLearning4j Demo
Ersatz meetup - DeepLearning4j DemoErsatz meetup - DeepLearning4j Demo
Ersatz meetup - DeepLearning4j Demo
 
Using browsing behavior history to predict user’s gender presenation
Using browsing behavior history to predict user’s gender   presenationUsing browsing behavior history to predict user’s gender   presenation
Using browsing behavior history to predict user’s gender presenation
 
Brief introduction to Distributed Deep Learning
Brief introduction to Distributed Deep LearningBrief introduction to Distributed Deep Learning
Brief introduction to Distributed Deep Learning
 
Deep Learning for Java (DL4J)
Deep Learning for Java (DL4J)Deep Learning for Java (DL4J)
Deep Learning for Java (DL4J)
 
Accelerating Hadoop, Spark, and Memcached with HPC Technologies
Accelerating Hadoop, Spark, and Memcached with HPC TechnologiesAccelerating Hadoop, Spark, and Memcached with HPC Technologies
Accelerating Hadoop, Spark, and Memcached with HPC Technologies
 
Recurrent nets and sensors
Recurrent nets and sensorsRecurrent nets and sensors
Recurrent nets and sensors
 
Hubba Deep Learning
Hubba Deep LearningHubba Deep Learning
Hubba Deep Learning
 
Support vector machine
Support vector machineSupport vector machine
Support vector machine
 
Skymind 深度学习 - T11 Summit
Skymind 深度学习 - T11 SummitSkymind 深度学习 - T11 Summit
Skymind 深度学习 - T11 Summit
 
Deep Learning on Production with Spark
Deep Learning on Production with SparkDeep Learning on Production with Spark
Deep Learning on Production with Spark
 
Support Vector Machine
Support Vector MachineSupport Vector Machine
Support Vector Machine
 
Lecture12 - SVM
Lecture12 - SVMLecture12 - SVM
Lecture12 - SVM
 
Deeplearning on Hadoop @OSCON 2014
Deeplearning on Hadoop @OSCON 2014Deeplearning on Hadoop @OSCON 2014
Deeplearning on Hadoop @OSCON 2014
 
DeepLearning4J: Open Source Neural Net Platform
DeepLearning4J: Open Source Neural Net PlatformDeepLearning4J: Open Source Neural Net Platform
DeepLearning4J: Open Source Neural Net Platform
 
Skymind's Platform - CN
Skymind's Platform - CNSkymind's Platform - CN
Skymind's Platform - CN
 
Deep Learning using Spark and DL4J for fun and profit
Deep Learning using Spark and DL4J for fun and profitDeep Learning using Spark and DL4J for fun and profit
Deep Learning using Spark and DL4J for fun and profit
 

Similar to DL4J at Workday Meetup

Data Science Accelerator Program
Data Science Accelerator ProgramData Science Accelerator Program
Data Science Accelerator Program
GoDataDriven
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updates
Vinay H G
 

Similar to DL4J at Workday Meetup (20)

Data Science Accelerator Program
Data Science Accelerator ProgramData Science Accelerator Program
Data Science Accelerator Program
 
Guglielmo iozzia - Google I/O extended dublin 2018
Guglielmo iozzia - Google  I/O extended dublin 2018Guglielmo iozzia - Google  I/O extended dublin 2018
Guglielmo iozzia - Google I/O extended dublin 2018
 
Applied Deep Learning with Spark and Deeplearning4j
Applied Deep Learning with Spark and Deeplearning4jApplied Deep Learning with Spark and Deeplearning4j
Applied Deep Learning with Spark and Deeplearning4j
 
Integrating Deep Learning Libraries with Apache Spark
Integrating Deep Learning Libraries with Apache SparkIntegrating Deep Learning Libraries with Apache Spark
Integrating Deep Learning Libraries with Apache Spark
 
Urs Köster - Convolutional and Recurrent Neural Networks
Urs Köster - Convolutional and Recurrent Neural NetworksUrs Köster - Convolutional and Recurrent Neural Networks
Urs Köster - Convolutional and Recurrent Neural Networks
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updates
 
Build, Scale, and Deploy Deep Learning Pipelines with Ease Using Apache Spark
Build, Scale, and Deploy Deep Learning Pipelines with Ease Using Apache SparkBuild, Scale, and Deploy Deep Learning Pipelines with Ease Using Apache Spark
Build, Scale, and Deploy Deep Learning Pipelines with Ease Using Apache Spark
 
DeepLearning4J and Spark: Successes and Challenges - François Garillot
DeepLearning4J and Spark: Successes and Challenges - François GarillotDeepLearning4J and Spark: Successes and Challenges - François Garillot
DeepLearning4J and Spark: Successes and Challenges - François Garillot
 
Build, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
Build, Scale, and Deploy Deep Learning Pipelines Using Apache SparkBuild, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
Build, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
 
Promises of Deep Learning
Promises of Deep LearningPromises of Deep Learning
Promises of Deep Learning
 
Deep Learning on Apache® Spark™: Workflows and Best Practices
Deep Learning on Apache® Spark™: Workflows and Best PracticesDeep Learning on Apache® Spark™: Workflows and Best Practices
Deep Learning on Apache® Spark™: Workflows and Best Practices
 
Deep Learning on Apache® Spark™: Workflows and Best Practices
Deep Learning on Apache® Spark™: Workflows and Best PracticesDeep Learning on Apache® Spark™: Workflows and Best Practices
Deep Learning on Apache® Spark™: Workflows and Best Practices
 
Icpp power ai-workshop 2018
Icpp power ai-workshop 2018Icpp power ai-workshop 2018
Icpp power ai-workshop 2018
 
Build, Scale, and Deploy Deep Learning Pipelines with Ease
Build, Scale, and Deploy Deep Learning Pipelines with EaseBuild, Scale, and Deploy Deep Learning Pipelines with Ease
Build, Scale, and Deploy Deep Learning Pipelines with Ease
 
Using JPA applications in the era of NoSQL: Introducing Hibernate OGM
Using JPA applications in the era of NoSQL: Introducing Hibernate OGMUsing JPA applications in the era of NoSQL: Introducing Hibernate OGM
Using JPA applications in the era of NoSQL: Introducing Hibernate OGM
 
Big Data Analytics (ML, DL, AI) hands-on
Big Data Analytics (ML, DL, AI) hands-onBig Data Analytics (ML, DL, AI) hands-on
Big Data Analytics (ML, DL, AI) hands-on
 
Flink Forward SF 2017: Dean Wampler - Streaming Deep Learning Scenarios with...
Flink Forward SF 2017: Dean Wampler -  Streaming Deep Learning Scenarios with...Flink Forward SF 2017: Dean Wampler -  Streaming Deep Learning Scenarios with...
Flink Forward SF 2017: Dean Wampler - Streaming Deep Learning Scenarios with...
 
10 Things I Wish I Dad Known Before Scaling Deep Learning Solutions
10 Things I Wish I Dad Known Before Scaling Deep Learning Solutions10 Things I Wish I Dad Known Before Scaling Deep Learning Solutions
10 Things I Wish I Dad Known Before Scaling Deep Learning Solutions
 
Leveraging NLP and Deep Learning for Document Recommendations in the Cloud
Leveraging NLP and Deep Learning for Document Recommendations in the CloudLeveraging NLP and Deep Learning for Document Recommendations in the Cloud
Leveraging NLP and Deep Learning for Document Recommendations in the Cloud
 
KERAS Python Tutorial
KERAS Python TutorialKERAS Python Tutorial
KERAS Python Tutorial
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

DL4J at Workday Meetup

  • 1. DL4J: Deep Learning for the JVM and Enterprise David C. Kale, Ruben Fiszel Skymind Workday Data Science Meetup August 10, 2016
  • 2. Who are we? • Deeplearning4j: open source deep learning on the JVM • Skymind: deep learning for enterprise • fighting good fight vs. python deep learning mafia • founded by Adam Gibson • CEO Chris Nicholson • Dave Kale: developer, Skymind: Scala API • also PhD student, USC • research: deep learning for healthcare • Ruben Fiszel: intern, Skymind: reinforcement learning (RL4J) • also MS student, EPFL
  • 3. Outline • Overview of deep learning • Tour of DL4J • Scaling up DL4J • DL4J versus… • Preview of DL4J Scala API • Preview of RL4J
  • 4. What is Deep Learning? • Compositions of (deterministic) differentiable functions, some parameterized • compute transformations of data • eventually emit output • can have multiple paths • architecture is end-to-end differentiable w.r.t. parameters (w’s) • training: • define targets, loss function • apply gradient methods: use chain rule to get component-wise updates x1 f1(x1;w1) z1 f2(z1) z2 f3(z2;w3) y Loss(y,t) t f4(x2;w4)x2 z4 f3([z2,z4]; w3)
  • 5. Example: multilayer perceptron • Classic “neural net” architecture — a powerful nonlinear function approximator • Zero or more fully connected (“dense”) layers of “neurons” • ex. neuron: h = f(Wx + b) for some nonlinearity f (e.g., ReLu(a) = max(a, 0)) • Predict y from fixed-size, not-too-large x with no structure • Classify digits in MNIST (digits are generally centered and upright) • Model risk of mortality in patients with pneumonia • Special case: logistic regression (zero hidden layers) http://deeplearning4j.org/mnist-for-beginners
  • 6. Variation of MLP: autoencoder • “Unsupervised” training: no separate target y • Learns to accurately reconstruct x from succinct latent z • Probabilistic generative variants (e.g., deep belief net) can generate novel x’s by first sampling z from prior probability distribution p(z) http://deeplearning4j.org/deepautoencoder
  • 7. Example: convolutional (neural) networks • Convolution layers “filter” x to extract features ➡ Filters exploit (spatially) local regularities while preserving spatial relationships • Subsampling (pooling) layers combine local information, reduce resolution ➡ pooling gives translational invariance (i.e., classifier robust to shifts in x) • Predict y from x with local structure (e.g., images, short time series) • 2D: classify images of, e.g., cats, cat may appear in different locations • 1D: diagnose patients from lab time series, symptoms at different times • Special case: fully convolutional network with no MLP at “top” (filter for variable-sized x’s) http://deeplearning4j.org/convolutionalnets 63 CONVOLUTIONAL NET Share the same parameters across different locations: Convolutions with learned kernels Ranzato (CVPR 2012 Tutorial, pt. 3 by M.A. Ranzato) http://deeplearning.net/tutorial/lenet.html
  • 8. Example: recurrent neural networks • Recurrent connections between hidden units: ht+1 = f(Wx + Vht) • Gives neural net a form of memory for capturing longterm dependencies • More elaborate RNNs (LSTMs) learn when/what to remember or forget • Predict y from sequential x (natural language, video, time series) • Among most flexible and powerful learning algorithms available • Also can be most challenging to train http://deeplearning4j.org/recurrentnetwork
  • 9. RNNs: flexible input-to-output modeling • Diagnose patients from temporal data (Lipton/Kale, ICLR 2016) • Predict next word or character (language modeling) • Generate beer review from category, score (Strata NY talk) • Translate from English to French (machine translation) http://karpathy.github.io/2015/05/21/rnn-effectiveness/
  • 10. Let’s get crazy with architectures • How about automatically captioning videos? • Recall: we are just composing functions that transform inputs • Compose ConvNets with RNNs • You can do this with DL4J today! (Venugopalan, et al., NAACL 2015)
  • 11. Machine learning in the deep learning era • Architecture design + hyperparameter tuning replace iterative feature engineering • Easier to transfer “knowledge” across problems • direct: can adapt generic image classifier into, e.g., tumor classifier • indirect: analogies across problems point to architectures • Often better able to leverage Big Data: • start with high capacity neural net • add regularization and tuning • None of the following is true: • your Big Data problems will all be solved magically • the machines are going to take over • the Singularity is right around the corner
  • 12. DL4J architecture for image captioning Shawn marries Maya’s Mom. Mr. Feeny officiates. LSTM MLP Conv Shawn marries Mr. Feeny. Some lady is there. Loss DL4J: MultilayerNetwork }DL4J: ConvolutionLayer DL4J: Dense DL4J: GravesLSTM DL4J: RnnOutputLayer DataVec: RecordReader ND4J: LossFunction DL4J: OptimizationAlgorithm Backpropagation
  • 13. DL4J ecosystem for scalable DL Arbiter • Platform agnostic model evaluation • Includes randomized grid search Spark API • Spark API wraps core DL4J classes • Designing and configuring model architecture identical • Currently provides data parallelism • Scales to massive datasets • Accelerated, distributed training • DataVec compatible with Spark RDDs Core • Efficient numpy-like numerical framework (ND4J) • ND4J backends for CUDA, ATLAS, MKL, OpenBLAS • Multi-GPU
  • 14. Scalable DL with Spark API • Use Downpour SGD model from (Dean, et al. NIPS 2012) • Data parallelism • training data sharded across workers • workers each have complete model, train in parallel on disjoint minibatches • Parameter averaging • Master stores “canonical” model parameters • Workers send parameter updates (gradients) to master • Workers periodically ask for updated parameters from master
  • 15. Example: LeNet image classifier LeNet on github
  • 16. Example: train LeNet on multi-GPU server multi-GPU example on github
  • 17. Example: distributed training of LeNet on Spark Spark LeNet example on github … …
  • 18. DL4J versus… • For comparison of frameworks, see • DL4J comparison page • Karpathy lecture • A zillion billion other blog posts and articles
  • 19. DL4J versus…my two cents • Using Java Big Data ecosystem (Hadoop, Spark, etc.): DL4J • Want robust data preprocessing tools/pipelines: DL4J • esp. natural language, images, video • Custom layers, loss functions, etc.: Theano/TF + keras/lasagne • grad student trying to publish NIPS papers • trying to win Kaggle competition with OpenAI model from NIPS (keras) • prototype an idea before implementing gradients by hand in DL4J • Use published CV models from Caffe zoo: Caffe • Python shop and don’t mind being hostage to Google Cloud: TF • Good news: this is a false choice, like most things (see Scala API)
  • 20. • Scala API for DL4J that emulates keras user experience • Goal: reduce friction for going between keras and DL4J • make it easy to mimic keras architectures • load models keras-trained using common model format (coming soon) DL4J Scala API Preview
  • 21. DL4J Scala API Keras DL4J Scala API Preview
  • 22. Thank you! • DL4J: http://deeplearning4j.org/ • Skymind: https://skymind.io/ • Dave: • email: dave@skymind.io • Twitter: @davekale • website: http://www-scf.usc.edu/~dkale • MLHC Conference: http://mucmd.org • Ruben • email: ruben.fiszel@epfl.ch • website: http://rubenfiszel.github.io/ Gibson & Patterson. Deep Learning: A Practitioner’s Approach. O’Reilly, Q2 2016.