SlideShare a Scribd company logo
skymind.io | deeplearning.org | gitter.im/deeplearning4j
DL4J and DataVec
Building Production Class Deep Learning Workflows for the Enterprise
Josh Patterson / Director Field Org
MLConf 2016 / Atlanta, GA
Josh Patterson
Director Field Engineering / Skymind
Co-Author: O’Reilly’s “Deep Learning: A Practitioners Approach”
Past:
Self-Organizing Mesh Networks / Meta-Heuristics Research
Smartgrid work / TVA + NERC
Principal Field Architect / Cloudera
Topics
• Deep Learning in Production for the Enterprise
• DL4J and DataVec
• Example Workflow: Modeling Sensor Data with RNNs
Deep Learning in Production
Defining Deep Learning
Higher neuron counts than in previous generation neural networks
Different and evolved ways to connect layers inside neural networks
More computing power to train
Automated Feature Learning
“machines that learn to represent the world”
Quick Usage Guide
• If I have Timeseries or Audio Input: Use a Recurrent Neural Network
• If I have Image input: Use a Convolutional Neural Network
• If I have Video input: Use a hybrid Convolutional + Recurrent Architecture!
The Challenge of the Fortune 500
Take business problem and translate it into a product-izable solution
• Get data together
• Understand modeling, pull together expertise
Get the right data workflow / infra architecture to production-ize application
• Security
• Integration
“Google is living a few years in the future and
sending the rest of us messages”
-- Doug Cutting in 2013
However
Most organizations are not built like Google
(and Jeff Dean does not work at your company…)
Anyone building Next-Gen infrastructure has to consider these things
Production Considerations
• Security – even though I can build a model, will IT let me
run it?
• Data Warehouse Integration – can I easily run this In the
existing IT footprint?
• Speedup – once I need to go faster, how hard is it to speed
up modeling?
DL4J and DataVec
DL4J and DataVec
• DL4J – ASF 2.0 Licensed JVM Platform for Enterprise Deep Learning
• DataVec - a tool for machine learning ETL (Extract, Transform, Load)
operations.
• Both run natively on Spark on CPU or GPU as Backends
• DL4J Suite certified on CDH5, HDP2.4, and upcoming IBM IOP platform.
ND4J: The Need for Speed
JavaCPP
• Auto generate JNI Bindings for C++
• Allows for easy maintenance and deployment of C++ binaries in Java
CPU Backends
• OpenMP (multithreading within native operations)
• OpenBLAS or MKL (BLAS operations)
• SIMD-extensions
GPU Backends
• DL4J supports Cuda 7.5 (+cuBLAS) at the moment, and will support 8.0 support as soon as it comes out.
• Leverages cuDNN as well
https://github.com/deeplearning4j/dl4j-benchmark
Prepping Data is Time Consuming
http://www.forbes.com/sites/gilpress/2016/03/23/data-preparation-most-time-consuming-least-enjoyable-data-science-task-survey-
says/#633ea7f67f75
Preparing Data for Modeling is Hard
DL4J Workflow Toolchain
ETL
(DataVec)
Vectorization
(DataVec)
Modeling
(DL4J)
Evaluation
(Arbiter)
Execution Platforms: Spark/Hadoop, Single Machine
ND4J - Linear Algebra Runtime: CPU, GPU
Modeling Sensor Data with RNNs and
DL4J
NERC Sensor Data Collection
openPDC PMU Data Collection circa 2009
• 120 Sensors
• 30 samples/second
• 4.3B Samples/day
• Housed in Hadoop
Classifying UCI Sensor Data: Trends
A – Downward Trend
B – Cyclic
C – Normal
D – Upward Shift
E – Upward Trend
F – Downward Shift
Loading and Transforming Timeseries Data with DataVec
SequenceRecordReader trainFeatures = new CSVSequenceRecordReader();
trainFeatures.initialize(new NumberedFileInputSplit(featuresDirTrain.getAbsolutePath() + "/%d.csv", 0, 449));
SequenceRecordReader trainLabels = new CSVSequenceRecordReader();
trainLabels.initialize(new NumberedFileInputSplit(labelsDirTrain.getAbsolutePath() + "/%d.csv", 0, 449));
int minibatch = 10;
int numLabelClasses = 6;
DataSetIterator trainData = new SequenceRecordReaderDataSetIterator(trainFeatures, trainLabels, minibatch,
numLabelClasses, false, SequenceRecordReaderDataSetIterator.AlignmentMode.ALIGN_END);
//Normalize the training data
DataNormalization normalizer = new NormalizerStandardize();
normalizer.fit(trainData); //Collect training data statistics
trainData.reset();
trainData.setPreProcessor(normalizer); //Use previously collected statistics to normalize on-the-fly
Configuring a Recurrent Neural Network with DL4J
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT).iterations(1)
.updater(Updater.NESTEROVS).momentum(0.9).learningRate(0.005)
.gradientNormalization(GradientNormalization.ClipElementWiseAbsoluteValue)
.gradientNormalizationThreshold(0.5)
.list()
.layer(0, new GravesLSTM.Builder().activation("tanh").nIn(1).nOut(10).build())
.layer(1, new RnnOutputLayer.Builder(LossFunctions.LossFunction.MCXENT)
.activation("softmax").nIn(10).nOut(numLabelClasses).build())
.pretrain(false).backprop(true).build();
MultiLayerNetwork net = new MultiLayerNetwork(conf);
net.init();
Train the Network on Local Machine
int nEpochs = 40;
String str = "Test set evaluation at epoch %d: Accuracy = %.2f, F1 = %.2f";
for (int i = 0; i < nEpochs; i++) {
net.fit(trainData);
//Evaluate on the test set:
Evaluation evaluation = net.evaluate(testData);
System.out.println(String.format(str, i, evaluation.accuracy(), evaluation.f1()));
testData.reset();
trainData.reset();
}
Train the Network on Spark
TrainingMaster tm = new ParameterAveragingTrainingMaster(true,executors_count,1,batchSizePerWorker,1,0);
//Create Spark multi layer network from configuration
SparkDl4jMultiLayer sparkNetwork = new SparkDl4jMultiLayer(sc, net, tm);
int nEpochs = 40;
String str = "Test set evaluation at epoch %d: Accuracy = %.2f, F1 = %.2f";
for (int i = 0; i < nEpochs; i++) {
sparkNetwork.fit(trainDataRDD);
//Evaluate on the test set:
Evaluation evaluation = net.evaluate(testData);
System.out.println(String.format(str, i, evaluation.accuracy(), evaluation.f1()));
testData.reset();
trainData.reset();
}
Thank you!
Please visit
skymind.io/learn for more
information
OR
Visit us at booth P33

More Related Content

What's hot (19)

PPTX
Georgia Tech cse6242 - Intro to Deep Learning and DL4J
Josh Patterson
 
PPTX
Hadoop Summit 2014 - San Jose - Introduction to Deep Learning on Hadoop
Josh Patterson
 
PPTX
Deep learning on Hadoop/Spark -NextML
Adam Gibson
 
PDF
DeepLearning4J and Spark: Successes and Challenges - François Garillot
Steve Moore
 
PDF
Building Deep Reinforcement Learning Applications on Apache Spark with Analyt...
Databricks
 
PDF
Build, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
Databricks
 
PDF
Integrating Deep Learning Libraries with Apache Spark
Databricks
 
PDF
Snorkel: Dark Data and Machine Learning with Christopher Ré
Jen Aman
 
PDF
Resource-Efficient Deep Learning Model Selection on Apache Spark
Databricks
 
PDF
Deep Learning on Apache® Spark™ : Workflows and Best Practices
Jen Aman
 
PDF
SparkApplicationDevMadeEasy_Spark_Summit_2015
Lance Co Ting Keh
 
PPTX
Deep Learning on Qubole Data Platform
Shivaji Dutta
 
PDF
High Performance Machine Learning in R with H2O
Sri Ambati
 
PDF
Introduction to GPUs for Machine Learning
Sri Ambati
 
PDF
Experience of Running Spark on Kubernetes on OpenStack for High Energy Physic...
Databricks
 
PDF
Sparkling Water 5 28-14
Sri Ambati
 
PDF
Spark as the Gateway Drug to Typed Functional Programming: Spark Summit East ...
Spark Summit
 
PPTX
Deep Learning with Spark and GPUs
DataWorks Summit
 
PDF
Distributed Inference on Large Datasets Using Apache MXNet and Apache Spark ...
Databricks
 
Georgia Tech cse6242 - Intro to Deep Learning and DL4J
Josh Patterson
 
Hadoop Summit 2014 - San Jose - Introduction to Deep Learning on Hadoop
Josh Patterson
 
Deep learning on Hadoop/Spark -NextML
Adam Gibson
 
DeepLearning4J and Spark: Successes and Challenges - François Garillot
Steve Moore
 
Building Deep Reinforcement Learning Applications on Apache Spark with Analyt...
Databricks
 
Build, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
Databricks
 
Integrating Deep Learning Libraries with Apache Spark
Databricks
 
Snorkel: Dark Data and Machine Learning with Christopher Ré
Jen Aman
 
Resource-Efficient Deep Learning Model Selection on Apache Spark
Databricks
 
Deep Learning on Apache® Spark™ : Workflows and Best Practices
Jen Aman
 
SparkApplicationDevMadeEasy_Spark_Summit_2015
Lance Co Ting Keh
 
Deep Learning on Qubole Data Platform
Shivaji Dutta
 
High Performance Machine Learning in R with H2O
Sri Ambati
 
Introduction to GPUs for Machine Learning
Sri Ambati
 
Experience of Running Spark on Kubernetes on OpenStack for High Energy Physic...
Databricks
 
Sparkling Water 5 28-14
Sri Ambati
 
Spark as the Gateway Drug to Typed Functional Programming: Spark Summit East ...
Spark Summit
 
Deep Learning with Spark and GPUs
DataWorks Summit
 
Distributed Inference on Large Datasets Using Apache MXNet and Apache Spark ...
Databricks
 

Viewers also liked (20)

ODP
Deep Learning for Java (DL4J)
신동 강
 
PPTX
Hadoop Summit 2014 Distributed Deep Learning
Adam Gibson
 
PPTX
Deep Belief nets
butest
 
PDF
Deep Learning for Information Retrieval: Models, Progress, & Opportunities
Matthew Lease
 
PDF
Introduction to TensorFlow
Matthias Feys
 
PPTX
Deep Learning using Spark and DL4J for fun and profit
DataWorks Summit/Hadoop Summit
 
PPTX
Suneel Marthi - Deep Learning with Apache Flink and DL4J
Flink Forward
 
PDF
WebDB Forum 2016 gunosy
Hiroaki Kudo
 
PDF
Chainer meetup20151014
Jiro Nishitoba
 
PPTX
Chainer Meetup LT (Alpaca)
Jun-ya Norimatsu
 
PDF
A Chainer MeetUp Talk
Yusuke Oda
 
PPTX
Chainer meetup
kikusu
 
PDF
LT@Chainer Meetup
Shunta Saito
 
PDF
スパースモデリング入門
Hideo Terada
 
PDF
Which Is Deeper - Comparison Of Deep Learning Frameworks On Spark
Spark Summit
 
PDF
Towards Chainer v1.5
Seiya Tokui
 
PDF
Lighting talk chainer hands on
Ogushi Masaya
 
PDF
Chainer meetup lt
Ace12358
 
PDF
Chainer Contribution Guide
Kenta Oono
 
PDF
PFN Spring Internship Final Report: Autonomous Drive by Deep RL
Naoto Yoshida
 
Deep Learning for Java (DL4J)
신동 강
 
Hadoop Summit 2014 Distributed Deep Learning
Adam Gibson
 
Deep Belief nets
butest
 
Deep Learning for Information Retrieval: Models, Progress, & Opportunities
Matthew Lease
 
Introduction to TensorFlow
Matthias Feys
 
Deep Learning using Spark and DL4J for fun and profit
DataWorks Summit/Hadoop Summit
 
Suneel Marthi - Deep Learning with Apache Flink and DL4J
Flink Forward
 
WebDB Forum 2016 gunosy
Hiroaki Kudo
 
Chainer meetup20151014
Jiro Nishitoba
 
Chainer Meetup LT (Alpaca)
Jun-ya Norimatsu
 
A Chainer MeetUp Talk
Yusuke Oda
 
Chainer meetup
kikusu
 
LT@Chainer Meetup
Shunta Saito
 
スパースモデリング入門
Hideo Terada
 
Which Is Deeper - Comparison Of Deep Learning Frameworks On Spark
Spark Summit
 
Towards Chainer v1.5
Seiya Tokui
 
Lighting talk chainer hands on
Ogushi Masaya
 
Chainer meetup lt
Ace12358
 
Chainer Contribution Guide
Kenta Oono
 
PFN Spring Internship Final Report: Autonomous Drive by Deep RL
Naoto Yoshida
 
Ad

Similar to Deep Learning: DL4J and DataVec (20)

PPTX
Applied Deep Learning with Spark and Deeplearning4j
DataWorks Summit
 
PDF
Introduction to parallel iterative deep learning on hadoop’s next​ generation...
Anh Le
 
PDF
Cognitive IoT using DeepLearning on data parallel frameworks like Spark & Flink
Romeo Kienzler
 
PPTX
Hadoop summit 2016
Adam Gibson
 
PDF
Deep Learning on Apache® Spark™: Workflows and Best Practices
Databricks
 
PDF
Deep Learning on Apache® Spark™: Workflows and Best Practices
Jen Aman
 
PDF
Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on ...
DataWorks Summit/Hadoop Summit
 
PPT
Deep Learning with DL4J on Apache Spark: Yeah it's Cool, but are You Doing it...
DataWorks Summit
 
PDF
Build, Scale, and Deploy Deep Learning Pipelines with Ease Using Apache Spark
Databricks
 
PDF
Guglielmo iozzia - Google I/O extended dublin 2018
Guglielmo Iozzia
 
PDF
Running deep neural nets in your Java application with Deeplearning4j
Alexander Fedintsev
 
PPTX
Emiliano Martinez | Deep learning in Spark Slides | Codemotion Madrid 2018
Codemotion
 
PDF
Fabric for Deep Learning
Animesh Singh
 
PPTX
Productionizing dl from the ground up
Adam Gibson
 
PDF
Distributed Deep Learning with Keras and TensorFlow on Apache Spark
Guglielmo Iozzia
 
PDF
Deeplearning on Hadoop @OSCON 2014
Adam Gibson
 
PDF
deep learning in production cff 2017
Ari Kamlani
 
PDF
Build, Scale, and Deploy Deep Learning Pipelines with Ease
Databricks
 
PPTX
Deep learning in automation industry
PIYUSHBHATIA33
 
PPTX
Deep Learning with Apache Spark: an Introduction
Emanuele Bezzi
 
Applied Deep Learning with Spark and Deeplearning4j
DataWorks Summit
 
Introduction to parallel iterative deep learning on hadoop’s next​ generation...
Anh Le
 
Cognitive IoT using DeepLearning on data parallel frameworks like Spark & Flink
Romeo Kienzler
 
Hadoop summit 2016
Adam Gibson
 
Deep Learning on Apache® Spark™: Workflows and Best Practices
Databricks
 
Deep Learning on Apache® Spark™: Workflows and Best Practices
Jen Aman
 
Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on ...
DataWorks Summit/Hadoop Summit
 
Deep Learning with DL4J on Apache Spark: Yeah it's Cool, but are You Doing it...
DataWorks Summit
 
Build, Scale, and Deploy Deep Learning Pipelines with Ease Using Apache Spark
Databricks
 
Guglielmo iozzia - Google I/O extended dublin 2018
Guglielmo Iozzia
 
Running deep neural nets in your Java application with Deeplearning4j
Alexander Fedintsev
 
Emiliano Martinez | Deep learning in Spark Slides | Codemotion Madrid 2018
Codemotion
 
Fabric for Deep Learning
Animesh Singh
 
Productionizing dl from the ground up
Adam Gibson
 
Distributed Deep Learning with Keras and TensorFlow on Apache Spark
Guglielmo Iozzia
 
Deeplearning on Hadoop @OSCON 2014
Adam Gibson
 
deep learning in production cff 2017
Ari Kamlani
 
Build, Scale, and Deploy Deep Learning Pipelines with Ease
Databricks
 
Deep learning in automation industry
PIYUSHBHATIA33
 
Deep Learning with Apache Spark: an Introduction
Emanuele Bezzi
 
Ad

More from Josh Patterson (14)

PPTX
Patterson Consulting: What is Artificial Intelligence?
Josh Patterson
 
PPTX
What is Artificial Intelligence
Josh Patterson
 
PPTX
Modeling Electronic Health Records with Recurrent Neural Networks
Josh Patterson
 
PPTX
Vectorization - Georgia Tech - CSE6242 - March 2015
Josh Patterson
 
PPTX
Chattanooga Hadoop Meetup - Hadoop 101 - November 2014
Josh Patterson
 
PPTX
Intro to Vectorization Concepts - GaTech cse6242
Josh Patterson
 
PPTX
MLConf 2013: Metronome and Parallel Iterative Algorithms on YARN
Josh Patterson
 
PPTX
Hadoop Summit EU 2013: Parallel Linear Regression, IterativeReduce, and YARN
Josh Patterson
 
PPTX
Knitting boar atl_hug_jan2013_v2
Josh Patterson
 
PPTX
Knitting boar - Toronto and Boston HUGs - Nov 2012
Josh Patterson
 
PPTX
LA HUG Dec 2011 - Recommendation Talk
Josh Patterson
 
PPTX
Oct 2011 CHADNUG Presentation on Hadoop
Josh Patterson
 
PPTX
Machine Learning and Hadoop
Josh Patterson
 
PPTX
Classification with Naive Bayes
Josh Patterson
 
Patterson Consulting: What is Artificial Intelligence?
Josh Patterson
 
What is Artificial Intelligence
Josh Patterson
 
Modeling Electronic Health Records with Recurrent Neural Networks
Josh Patterson
 
Vectorization - Georgia Tech - CSE6242 - March 2015
Josh Patterson
 
Chattanooga Hadoop Meetup - Hadoop 101 - November 2014
Josh Patterson
 
Intro to Vectorization Concepts - GaTech cse6242
Josh Patterson
 
MLConf 2013: Metronome and Parallel Iterative Algorithms on YARN
Josh Patterson
 
Hadoop Summit EU 2013: Parallel Linear Regression, IterativeReduce, and YARN
Josh Patterson
 
Knitting boar atl_hug_jan2013_v2
Josh Patterson
 
Knitting boar - Toronto and Boston HUGs - Nov 2012
Josh Patterson
 
LA HUG Dec 2011 - Recommendation Talk
Josh Patterson
 
Oct 2011 CHADNUG Presentation on Hadoop
Josh Patterson
 
Machine Learning and Hadoop
Josh Patterson
 
Classification with Naive Bayes
Josh Patterson
 

Recently uploaded (20)

PPTX
apidays Helsinki & North 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (A...
apidays
 
PDF
Early_Diabetes_Detection_using_Machine_L.pdf
maria879693
 
PPT
Growth of Public Expendituuure_55423.ppt
NavyaDeora
 
PDF
apidays Helsinki & North 2025 - How (not) to run a Graphql Stewardship Group,...
apidays
 
PDF
OPPOTUS - Malaysias on Malaysia 1Q2025.pdf
Oppotus
 
PPTX
apidays Helsinki & North 2025 - API access control strategies beyond JWT bear...
apidays
 
PPTX
apidays Munich 2025 - Building Telco-Aware Apps with Open Gateway APIs, Subhr...
apidays
 
PPTX
Module-5-Measures-of-Central-Tendency-Grouped-Data-1.pptx
lacsonjhoma0407
 
PPTX
apidays Singapore 2025 - Designing for Change, Julie Schiller (Google)
apidays
 
PPTX
GenAI-Introduction-to-Copilot-for-Bing-March-2025-FOR-HUB.pptx
cleydsonborges1
 
PPT
deep dive data management sharepoint apps.ppt
novaprofk
 
PDF
Choosing the Right Database for Indexing.pdf
Tamanna
 
PDF
apidays Helsinki & North 2025 - APIs in the healthcare sector: hospitals inte...
apidays
 
PPTX
Climate Action.pptx action plan for climate
justfortalabat
 
PPTX
apidays Helsinki & North 2025 - APIs at Scale: Designing for Alignment, Trust...
apidays
 
PDF
Data Chunking Strategies for RAG in 2025.pdf
Tamanna
 
PDF
How to Connect Your On-Premises Site to AWS Using Site-to-Site VPN.pdf
Tamanna
 
PDF
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
PDF
Copia de Strategic Roadmap Infographics by Slidesgo.pptx (1).pdf
ssuserd4c6911
 
PDF
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
apidays Helsinki & North 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (A...
apidays
 
Early_Diabetes_Detection_using_Machine_L.pdf
maria879693
 
Growth of Public Expendituuure_55423.ppt
NavyaDeora
 
apidays Helsinki & North 2025 - How (not) to run a Graphql Stewardship Group,...
apidays
 
OPPOTUS - Malaysias on Malaysia 1Q2025.pdf
Oppotus
 
apidays Helsinki & North 2025 - API access control strategies beyond JWT bear...
apidays
 
apidays Munich 2025 - Building Telco-Aware Apps with Open Gateway APIs, Subhr...
apidays
 
Module-5-Measures-of-Central-Tendency-Grouped-Data-1.pptx
lacsonjhoma0407
 
apidays Singapore 2025 - Designing for Change, Julie Schiller (Google)
apidays
 
GenAI-Introduction-to-Copilot-for-Bing-March-2025-FOR-HUB.pptx
cleydsonborges1
 
deep dive data management sharepoint apps.ppt
novaprofk
 
Choosing the Right Database for Indexing.pdf
Tamanna
 
apidays Helsinki & North 2025 - APIs in the healthcare sector: hospitals inte...
apidays
 
Climate Action.pptx action plan for climate
justfortalabat
 
apidays Helsinki & North 2025 - APIs at Scale: Designing for Alignment, Trust...
apidays
 
Data Chunking Strategies for RAG in 2025.pdf
Tamanna
 
How to Connect Your On-Premises Site to AWS Using Site-to-Site VPN.pdf
Tamanna
 
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
Copia de Strategic Roadmap Infographics by Slidesgo.pptx (1).pdf
ssuserd4c6911
 
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 

Deep Learning: DL4J and DataVec

  • 1. skymind.io | deeplearning.org | gitter.im/deeplearning4j DL4J and DataVec Building Production Class Deep Learning Workflows for the Enterprise Josh Patterson / Director Field Org MLConf 2016 / Atlanta, GA
  • 2. Josh Patterson Director Field Engineering / Skymind Co-Author: O’Reilly’s “Deep Learning: A Practitioners Approach” Past: Self-Organizing Mesh Networks / Meta-Heuristics Research Smartgrid work / TVA + NERC Principal Field Architect / Cloudera
  • 3. Topics • Deep Learning in Production for the Enterprise • DL4J and DataVec • Example Workflow: Modeling Sensor Data with RNNs
  • 4. Deep Learning in Production
  • 5. Defining Deep Learning Higher neuron counts than in previous generation neural networks Different and evolved ways to connect layers inside neural networks More computing power to train Automated Feature Learning “machines that learn to represent the world”
  • 6. Quick Usage Guide • If I have Timeseries or Audio Input: Use a Recurrent Neural Network • If I have Image input: Use a Convolutional Neural Network • If I have Video input: Use a hybrid Convolutional + Recurrent Architecture!
  • 7. The Challenge of the Fortune 500 Take business problem and translate it into a product-izable solution • Get data together • Understand modeling, pull together expertise Get the right data workflow / infra architecture to production-ize application • Security • Integration
  • 8. “Google is living a few years in the future and sending the rest of us messages” -- Doug Cutting in 2013 However Most organizations are not built like Google (and Jeff Dean does not work at your company…) Anyone building Next-Gen infrastructure has to consider these things
  • 9. Production Considerations • Security – even though I can build a model, will IT let me run it? • Data Warehouse Integration – can I easily run this In the existing IT footprint? • Speedup – once I need to go faster, how hard is it to speed up modeling?
  • 11. DL4J and DataVec • DL4J – ASF 2.0 Licensed JVM Platform for Enterprise Deep Learning • DataVec - a tool for machine learning ETL (Extract, Transform, Load) operations. • Both run natively on Spark on CPU or GPU as Backends • DL4J Suite certified on CDH5, HDP2.4, and upcoming IBM IOP platform.
  • 12. ND4J: The Need for Speed JavaCPP • Auto generate JNI Bindings for C++ • Allows for easy maintenance and deployment of C++ binaries in Java CPU Backends • OpenMP (multithreading within native operations) • OpenBLAS or MKL (BLAS operations) • SIMD-extensions GPU Backends • DL4J supports Cuda 7.5 (+cuBLAS) at the moment, and will support 8.0 support as soon as it comes out. • Leverages cuDNN as well https://github.com/deeplearning4j/dl4j-benchmark
  • 13. Prepping Data is Time Consuming http://www.forbes.com/sites/gilpress/2016/03/23/data-preparation-most-time-consuming-least-enjoyable-data-science-task-survey- says/#633ea7f67f75
  • 14. Preparing Data for Modeling is Hard
  • 15. DL4J Workflow Toolchain ETL (DataVec) Vectorization (DataVec) Modeling (DL4J) Evaluation (Arbiter) Execution Platforms: Spark/Hadoop, Single Machine ND4J - Linear Algebra Runtime: CPU, GPU
  • 16. Modeling Sensor Data with RNNs and DL4J
  • 17. NERC Sensor Data Collection openPDC PMU Data Collection circa 2009 • 120 Sensors • 30 samples/second • 4.3B Samples/day • Housed in Hadoop
  • 18. Classifying UCI Sensor Data: Trends A – Downward Trend B – Cyclic C – Normal D – Upward Shift E – Upward Trend F – Downward Shift
  • 19. Loading and Transforming Timeseries Data with DataVec SequenceRecordReader trainFeatures = new CSVSequenceRecordReader(); trainFeatures.initialize(new NumberedFileInputSplit(featuresDirTrain.getAbsolutePath() + "/%d.csv", 0, 449)); SequenceRecordReader trainLabels = new CSVSequenceRecordReader(); trainLabels.initialize(new NumberedFileInputSplit(labelsDirTrain.getAbsolutePath() + "/%d.csv", 0, 449)); int minibatch = 10; int numLabelClasses = 6; DataSetIterator trainData = new SequenceRecordReaderDataSetIterator(trainFeatures, trainLabels, minibatch, numLabelClasses, false, SequenceRecordReaderDataSetIterator.AlignmentMode.ALIGN_END); //Normalize the training data DataNormalization normalizer = new NormalizerStandardize(); normalizer.fit(trainData); //Collect training data statistics trainData.reset(); trainData.setPreProcessor(normalizer); //Use previously collected statistics to normalize on-the-fly
  • 20. Configuring a Recurrent Neural Network with DL4J MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder() .optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT).iterations(1) .updater(Updater.NESTEROVS).momentum(0.9).learningRate(0.005) .gradientNormalization(GradientNormalization.ClipElementWiseAbsoluteValue) .gradientNormalizationThreshold(0.5) .list() .layer(0, new GravesLSTM.Builder().activation("tanh").nIn(1).nOut(10).build()) .layer(1, new RnnOutputLayer.Builder(LossFunctions.LossFunction.MCXENT) .activation("softmax").nIn(10).nOut(numLabelClasses).build()) .pretrain(false).backprop(true).build(); MultiLayerNetwork net = new MultiLayerNetwork(conf); net.init();
  • 21. Train the Network on Local Machine int nEpochs = 40; String str = "Test set evaluation at epoch %d: Accuracy = %.2f, F1 = %.2f"; for (int i = 0; i < nEpochs; i++) { net.fit(trainData); //Evaluate on the test set: Evaluation evaluation = net.evaluate(testData); System.out.println(String.format(str, i, evaluation.accuracy(), evaluation.f1())); testData.reset(); trainData.reset(); }
  • 22. Train the Network on Spark TrainingMaster tm = new ParameterAveragingTrainingMaster(true,executors_count,1,batchSizePerWorker,1,0); //Create Spark multi layer network from configuration SparkDl4jMultiLayer sparkNetwork = new SparkDl4jMultiLayer(sc, net, tm); int nEpochs = 40; String str = "Test set evaluation at epoch %d: Accuracy = %.2f, F1 = %.2f"; for (int i = 0; i < nEpochs; i++) { sparkNetwork.fit(trainDataRDD); //Evaluate on the test set: Evaluation evaluation = net.evaluate(testData); System.out.println(String.format(str, i, evaluation.accuracy(), evaluation.f1())); testData.reset(); trainData.reset(); }
  • 23. Thank you! Please visit skymind.io/learn for more information OR Visit us at booth P33

Editor's Notes

  • #8: Talk through Tellus story around can’t get product out there
  • #13: Just like Ricky Bobby, we like to go fast at Skymind
  • #15: No alignment attempted per timestep across records, just indexing each recorded timestep (simpler way to find long term dependencies) Alternative was: (60sec) x (60min) x (48h) == 172,800 timesteps (not easy to model)
  • #18: OpenPDC setup Blackouts NERC wants visibility SCADA lmited Lots of data coming in Hey you, fix this!