SlideShare a Scribd company logo
Enterprise Deep Learning with DL4J
Skymind
Josh Patterson
Hadoop Summit 2015
Presenter: Josh Patterson
Past
Research in Swarm Algorithms
Real-time optimization techniques in mesh sensor networks
TVA / NERC
Smartgrid, Sensor Collection, and Big Data
Cloudera
Today
Patterson Consulting
josh@pattersonconsultingtn.com
Skymind (Advisor)
josh@skymind.io / @jpatanooga
Architecture, Committer on DL4J
Topics
• What is Deep Learning?
• What is DL4J?
• Enterprise Grade Deep Learning Workflows
WHAT IS DEEP LEARNING?
We Want to be able to recognize
Handwriting
This is a Hard Problem
Automated Feature Engineering
• Deep Learning can be thought of as workflows for
automated feature construction
– Where previously we’d consider each stage in the
workflow as unique technique
• Many of the techniques have been around for
years
– But now are being chained together in a way that
automates exotic feature engineering
• As LeCun says:
– “machines that learn to represent the world”
Deep learning with DL4J - Hadoop Summit 2015
Deep learning with DL4J - Hadoop Summit 2015
These are the features learned at each neuron in a Restricted Boltzmann Machine
(RBMS)
These features are passed to higher levels of RBMs to learn more complicated things.
Part of the
“7” digit
Learning Progressive Layers
Deep Learning Architectures
• Deep Belief Networks
– Most common architecture
• Convolutional Neural Networks
– State of the art in image classification
• Recurrent Networks
– Timeseries
• Recursive Networks
– Text / image
– Can break down scenes
DL4J
Next Generation Deep Learning with
DL4J
• “The Hadoop of Deep Learning”
– Command line driven
– Java, Scala, and Python APIs
– ASF 2.0 Licensed
• Java implementation
– Parallelization (Yarn, Spark)
– GPU support
• Also Supports multi-GPU per host
• Runtime Neutral
– Local
– Hadoop / YARN
– Spark
– AWS
• https://github.com/deeplearning4j/deeplearning4j
Issues in Machine Learning
• Data Gravity
– We need to process the data in workflows where the data lives
• If you move data you don’t have big data
– Even if the data is not “big” we still want simpler workflows
• Integration Issues
– Ingest, ETL, Vectorization, Modeling, Evaluation, and
Deployment issues
– Most ML tools are built with previous generation architectures
in mind
• Legacy Architectures
– Parallel iterative algorithm architectures are not common
DL4J Suite of Tools
• DL4J
– Main library for deep learning
• Canova
– Vectorization library
• ND4J
– Linear Algebra framework
– Swappable backends (JBLAS, GPUs):
• http://www.slideshare.net/agibsonccc/future-of-ai-on-the-jvm
• Arbiter
– Model evaluation and testing platform
DEEP LEARNING AND SPARK
Enterprise Grade
DL4J and Parallelization
17
Model
Training Data
Worker 1
Master
Partial
Model
Global Model
Worker 2
Partial Model
Worker N
Partial
Model
Split 1 Split 2 Split 3
…
Traditional Serial Training Modern Parallel Engine
(Hadoop / Spark)
DL4J Spark / GPUs via API
public class SparkGpuExample {
public static void main(String[] args) throws Exception {
Nd4j.MAX_ELEMENTS_PER_SLICE = Integer.MAX_VALUE;
Nd4j.MAX_SLICES_TO_PRINT = Integer.MAX_VALUE;
// set to test mode
SparkConf sparkConf = new SparkConf()
.setMaster("local[*]").set(SparkDl4jMultiLayer.AVERAGE_EACH_ITERATION,"false")
.set("spark.akka.frameSize", "100")
.setAppName("mnist");
System.out.println("Setting up Spark Context...");
JavaSparkContext sc = new JavaSparkContext(sparkConf);
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
.momentum(0.9).iterations(10)
.weightInit(WeightInit.DISTRIBUTION).batchSize(10000)
.dist(new NormalDistribution(0, 1)).lossFunction(LossFunctions.LossFunction.RMSE_XENT)
.nIn(784).nOut(10).layer(new RBM())
.list(4).hiddenLayerSizes(600, 500, 400)
.override(3, new ClassifierOverride()).build();
System.out.println("Initializing network");
SparkDl4jMultiLayer master = new SparkDl4jMultiLayer(sc,conf);
DataSet d = new MnistDataSetIterator(60000,60000).next();
List<DataSet> next = d.asList();
JavaRDD<DataSet> data = sc.parallelize(next);
MultiLayerNetwork network2 = master.fitDataSet(data);
Evaluation evaluation = new Evaluation();
evaluation.eval(d.getLabels(),network2.output(d.getFeatureMatrix()));
System.out.println("Averaged once " + evaluation.stats());
INDArray params = network2.params();
Nd4j.writeTxt(params,"params.txt",",");
FileUtils.writeStringToFile(new File("conf.json"), network2.getLayerWiseConfigurations().toJson());
}
}
Turn on GPUs and Spark
<dependency>
<groupId>org.deeplearning4j</groupId>
<artifactId>dl4j-spark</artifactId>
<version>${dl4j.version}</version>
</dependency>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-jcublas-7.0</artifactId>
<version>${nd4j.version}</version>
</dependency>
Building Deep Learning Workflows
• We need to get data from a raw format into a
baseline raw vector
– Model the data
– Evaluate the Model
• Traditionally these are all tied together in one
tool
– But this is a monolithic pattern
– We’d like to apply the unix principles here
• The DL4J Suite of Tools lets us do this
Modeling UCI Data: Iris
• We need to vectorize the data
– Possibly with some per column transformations
– Let’s use Canova
• We then need to build a deep learning model
over the data
– We’ll use the DL4J lib to do this
• Finally we’ll evaluate what happened
– This is where Arbiter comes in
Canova for Command Line Vectorization
• Library of tools to take
– Audio
– Video
– Image
– Text
– CSV data
• And convert the input data into vectors in a
standardized format
– Adaptable with custom input/output formats
• Open Source, ASF 2.0 Licensed
– https://github.com/deeplearning4j/Canova
– Part of DL4J suite
Vectorization with Canova
• Setup the configuration file
– Input Formats
– Output Formats
– Setup data types to vectorize
• Setup the schema transforms for the input
CSV data
• Generate the SVMLight vector data as the
output
– with the command line interface
Workflow Configuration (iris_conf.txt)
input.header.skip=false
input.statistics.debug.print=false
input.format=org.canova.api.formats.input.impl.LineInputFormat
input.directory=src/test/resources/csv/data/uci_iris_sample.txt
input.vector.schema=src/test/resources/csv/schemas/uci/iris.txt
output.directory=/tmp/iris_unit_test_sample.txt
output.format=org.canova.api.formats.output.impl.SVMLightOutputFormat
Iris Canova Vector Schema
@RELATION UCIIrisDataset
@DELIMITER ,
@ATTRIBUTE sepallength NUMERIC !NORMALIZE
@ATTRIBUTE sepalwidth NUMERIC !NORMALIZE
@ATTRIBUTE petallength NUMERIC !NORMALIZE
@ATTRIBUTE petalwidth NUMERIC !NORMALIZE
@ATTRIBUTE class STRING !LABEL
Model UCI Iris From CLI
./bin/canova vectorize -conf /tmp/iris_conf.txt
File path already exists, deleting the old file before proceeding...
Output vectors written to: /tmp/iris_svmlight.txt
./bin/dl4j train –conf /tmp/iris_conf.txt
[ …log output… ]
./bin/arbiter evaluate –conf /tmp/iris_conf.txt
[ …log output… ]
Skymind as DL4J Distribution
• Just as Redhat was to Linux
– A distribution of Linux with enterprise grade
packaging
• Just as Cloudera/Horton are to Hadoop
– A distribution of Apache Hadoop with enterprise
grade packaging
• Skymind is to DL4J
– A distribution of DL4J (+tool suite) with enterprise
grade packaging
Questions?
Thank you for your time and attention
“Deep Learning: A Practitioner’s Approach”
(Oreilly, October 2015)

More Related Content

What's hot (20)

PPTX
Deep learning on Hadoop/Spark -NextML
Adam Gibson
 
PPTX
Smart Data Conference: DL4J and DataVec
Josh Patterson
 
PDF
Deep Learning on Apache® Spark™ : Workflows and Best Practices
Jen Aman
 
PDF
DeepLearning4J and Spark: Successes and Challenges - François Garillot
Steve Moore
 
PPTX
Vectorization - Georgia Tech - CSE6242 - March 2015
Josh Patterson
 
PDF
Snorkel: Dark Data and Machine Learning with Christopher Ré
Jen Aman
 
PPTX
Deep Learning on Qubole Data Platform
Shivaji Dutta
 
PPTX
Amazon Deep Learning
Amanda Mackay (she/her)
 
PDF
Distributed Inference on Large Datasets Using Apache MXNet and Apache Spark ...
Databricks
 
PDF
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & Deep Learning ...
Databricks
 
PDF
Deploying Enterprise Deep Learning Masterclass Preview - Enterprise Deep Lea...
Sam Putnam [Deep Learning]
 
PDF
Apache MXNet ODSC West 2018
Apache MXNet
 
PDF
Apache Spark MLlib's Past Trajectory and New Directions with Joseph Bradley
Databricks
 
PDF
Kaz Sato, Evangelist, Google at MLconf ATL 2016
MLconf
 
PDF
System Update 2010 CrossRef Workshops
Crossref
 
PPTX
Deep Learning Frameworks 2019 | Which Deep Learning Framework To Use | Deep L...
Simplilearn
 
PDF
A Tale of Three Tools: Kubernetes, Jsonnet, and Bazel
Databricks
 
PDF
Scalable Machine Learning in R and Python with H2O
Sri Ambati
 
PDF
DeepLearning001&ApacheMXNetWithSparkForInference-ACNA2018
Apache MXNet
 
PDF
Apache Toree
Asim Jalis
 
Deep learning on Hadoop/Spark -NextML
Adam Gibson
 
Smart Data Conference: DL4J and DataVec
Josh Patterson
 
Deep Learning on Apache® Spark™ : Workflows and Best Practices
Jen Aman
 
DeepLearning4J and Spark: Successes and Challenges - François Garillot
Steve Moore
 
Vectorization - Georgia Tech - CSE6242 - March 2015
Josh Patterson
 
Snorkel: Dark Data and Machine Learning with Christopher Ré
Jen Aman
 
Deep Learning on Qubole Data Platform
Shivaji Dutta
 
Amazon Deep Learning
Amanda Mackay (she/her)
 
Distributed Inference on Large Datasets Using Apache MXNet and Apache Spark ...
Databricks
 
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & Deep Learning ...
Databricks
 
Deploying Enterprise Deep Learning Masterclass Preview - Enterprise Deep Lea...
Sam Putnam [Deep Learning]
 
Apache MXNet ODSC West 2018
Apache MXNet
 
Apache Spark MLlib's Past Trajectory and New Directions with Joseph Bradley
Databricks
 
Kaz Sato, Evangelist, Google at MLconf ATL 2016
MLconf
 
System Update 2010 CrossRef Workshops
Crossref
 
Deep Learning Frameworks 2019 | Which Deep Learning Framework To Use | Deep L...
Simplilearn
 
A Tale of Three Tools: Kubernetes, Jsonnet, and Bazel
Databricks
 
Scalable Machine Learning in R and Python with H2O
Sri Ambati
 
DeepLearning001&ApacheMXNetWithSparkForInference-ACNA2018
Apache MXNet
 
Apache Toree
Asim Jalis
 

Similar to Deep learning with DL4J - Hadoop Summit 2015 (20)

PPTX
Applied Deep Learning with Spark and Deeplearning4j
DataWorks Summit
 
PPTX
Big Data Introduction - Solix empower
Durga Gadiraju
 
PPTX
Josh Patterson, Advisor, Skymind – Deep learning for Industry at MLconf ATL 2016
MLconf
 
PDF
Build, Scale, and Deploy Deep Learning Pipelines with Ease Using Apache Spark
Databricks
 
PDF
Deep Learning on Apache® Spark™: Workflows and Best Practices
Databricks
 
PDF
Deep Learning on Apache® Spark™: Workflows and Best Practices
Jen Aman
 
PPTX
Data Science at Scale: Using Apache Spark for Data Science at Bitly
Sarah Guido
 
PDF
Build, Scale, and Deploy Deep Learning Pipelines with Ease
Databricks
 
PDF
Bringing Deep Learning into production
Paolo Platter
 
PDF
Integrating Deep Learning Libraries with Apache Spark
Databricks
 
PDF
A Maturing Role of Workflows in the Presence of Heterogenous Computing Archit...
Ilkay Altintas, Ph.D.
 
PDF
Apache Spark for Everyone - Women Who Code Workshop
Amanda Casari
 
PPTX
No sql and sql - open analytics summit
Open Analytics
 
PDF
DataOps with Project Amaterasu
DataWorks Summit/Hadoop Summit
 
PPTX
Introduction to Data Engineering
Durga Gadiraju
 
PPTX
A machine learning and data science pipeline for real companies
DataWorks Summit
 
PDF
From a student to an apache committer practice of apache io tdb
jixuan1989
 
PPTX
Suneel Marthi - Deep Learning with Apache Flink and DL4J
Flink Forward
 
PDF
Deep learning and Apache Spark
QuantUniversity
 
PDF
CaffeOnSpark: Deep Learning On Spark Cluster
Jen Aman
 
Applied Deep Learning with Spark and Deeplearning4j
DataWorks Summit
 
Big Data Introduction - Solix empower
Durga Gadiraju
 
Josh Patterson, Advisor, Skymind – Deep learning for Industry at MLconf ATL 2016
MLconf
 
Build, Scale, and Deploy Deep Learning Pipelines with Ease Using Apache Spark
Databricks
 
Deep Learning on Apache® Spark™: Workflows and Best Practices
Databricks
 
Deep Learning on Apache® Spark™: Workflows and Best Practices
Jen Aman
 
Data Science at Scale: Using Apache Spark for Data Science at Bitly
Sarah Guido
 
Build, Scale, and Deploy Deep Learning Pipelines with Ease
Databricks
 
Bringing Deep Learning into production
Paolo Platter
 
Integrating Deep Learning Libraries with Apache Spark
Databricks
 
A Maturing Role of Workflows in the Presence of Heterogenous Computing Archit...
Ilkay Altintas, Ph.D.
 
Apache Spark for Everyone - Women Who Code Workshop
Amanda Casari
 
No sql and sql - open analytics summit
Open Analytics
 
DataOps with Project Amaterasu
DataWorks Summit/Hadoop Summit
 
Introduction to Data Engineering
Durga Gadiraju
 
A machine learning and data science pipeline for real companies
DataWorks Summit
 
From a student to an apache committer practice of apache io tdb
jixuan1989
 
Suneel Marthi - Deep Learning with Apache Flink and DL4J
Flink Forward
 
Deep learning and Apache Spark
QuantUniversity
 
CaffeOnSpark: Deep Learning On Spark Cluster
Jen Aman
 
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
Chattanooga Hadoop Meetup - Hadoop 101 - November 2014
Josh Patterson
 
PPTX
Intro to Vectorization Concepts - GaTech cse6242
Josh Patterson
 
PPTX
Hadoop Summit 2014 - San Jose - Introduction to Deep Learning on Hadoop
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
 
Chattanooga Hadoop Meetup - Hadoop 101 - November 2014
Josh Patterson
 
Intro to Vectorization Concepts - GaTech cse6242
Josh Patterson
 
Hadoop Summit 2014 - San Jose - Introduction to Deep Learning on Hadoop
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
 
Ad

Recently uploaded (20)

PDF
Product Management in HealthTech (Case Studies from SnappDoctor)
Hamed Shams
 
PDF
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
PDF
MusicVideoProjectRubric Animation production music video.pdf
ALBERTIANCASUGA
 
PPTX
apidays Helsinki & North 2025 - Vero APIs - Experiences of API development in...
apidays
 
PPTX
recruitment Presentation.pptxhdhshhshshhehh
devraj40467
 
PPTX
Resmed Rady Landis May 4th - analytics.pptx
Adrian Limanto
 
PDF
List of all the AI prompt cheat codes.pdf
Avijit Kumar Roy
 
PDF
apidays Helsinki & North 2025 - APIs in the healthcare sector: hospitals inte...
apidays
 
PPT
01 presentation finyyyal معهد معايره.ppt
eltohamym057
 
PPT
Data base management system Transactions.ppt
gandhamcharan2006
 
PDF
What does good look like - CRAP Brighton 8 July 2025
Jan Kierzyk
 
PDF
2_Management_of_patients_with_Reproductive_System_Disorders.pdf
motbayhonewunetu
 
PPTX
Module-5-Measures-of-Central-Tendency-Grouped-Data-1.pptx
lacsonjhoma0407
 
PPTX
apidays Munich 2025 - Building Telco-Aware Apps with Open Gateway APIs, Subhr...
apidays
 
PPTX
apidays Munich 2025 - Building an AWS Serverless Application with Terraform, ...
apidays
 
PPTX
Rational Functions, Equations, and Inequalities (1).pptx
mdregaspi24
 
PDF
Early_Diabetes_Detection_using_Machine_L.pdf
maria879693
 
DOCX
AI/ML Applications in Financial domain projects
Rituparna De
 
PDF
Avatar for apidays apidays PRO June 07, 2025 0 5 apidays Helsinki & North 2...
apidays
 
PDF
apidays Helsinki & North 2025 - How (not) to run a Graphql Stewardship Group,...
apidays
 
Product Management in HealthTech (Case Studies from SnappDoctor)
Hamed Shams
 
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
MusicVideoProjectRubric Animation production music video.pdf
ALBERTIANCASUGA
 
apidays Helsinki & North 2025 - Vero APIs - Experiences of API development in...
apidays
 
recruitment Presentation.pptxhdhshhshshhehh
devraj40467
 
Resmed Rady Landis May 4th - analytics.pptx
Adrian Limanto
 
List of all the AI prompt cheat codes.pdf
Avijit Kumar Roy
 
apidays Helsinki & North 2025 - APIs in the healthcare sector: hospitals inte...
apidays
 
01 presentation finyyyal معهد معايره.ppt
eltohamym057
 
Data base management system Transactions.ppt
gandhamcharan2006
 
What does good look like - CRAP Brighton 8 July 2025
Jan Kierzyk
 
2_Management_of_patients_with_Reproductive_System_Disorders.pdf
motbayhonewunetu
 
Module-5-Measures-of-Central-Tendency-Grouped-Data-1.pptx
lacsonjhoma0407
 
apidays Munich 2025 - Building Telco-Aware Apps with Open Gateway APIs, Subhr...
apidays
 
apidays Munich 2025 - Building an AWS Serverless Application with Terraform, ...
apidays
 
Rational Functions, Equations, and Inequalities (1).pptx
mdregaspi24
 
Early_Diabetes_Detection_using_Machine_L.pdf
maria879693
 
AI/ML Applications in Financial domain projects
Rituparna De
 
Avatar for apidays apidays PRO June 07, 2025 0 5 apidays Helsinki & North 2...
apidays
 
apidays Helsinki & North 2025 - How (not) to run a Graphql Stewardship Group,...
apidays
 

Deep learning with DL4J - Hadoop Summit 2015

  • 1. Enterprise Deep Learning with DL4J Skymind Josh Patterson Hadoop Summit 2015
  • 2. Presenter: Josh Patterson Past Research in Swarm Algorithms Real-time optimization techniques in mesh sensor networks TVA / NERC Smartgrid, Sensor Collection, and Big Data Cloudera Today Patterson Consulting [email protected] Skymind (Advisor) [email protected] / @jpatanooga Architecture, Committer on DL4J
  • 3. Topics • What is Deep Learning? • What is DL4J? • Enterprise Grade Deep Learning Workflows
  • 4. WHAT IS DEEP LEARNING?
  • 5. We Want to be able to recognize Handwriting This is a Hard Problem
  • 6. Automated Feature Engineering • Deep Learning can be thought of as workflows for automated feature construction – Where previously we’d consider each stage in the workflow as unique technique • Many of the techniques have been around for years – But now are being chained together in a way that automates exotic feature engineering • As LeCun says: – “machines that learn to represent the world”
  • 9. These are the features learned at each neuron in a Restricted Boltzmann Machine (RBMS) These features are passed to higher levels of RBMs to learn more complicated things. Part of the “7” digit
  • 11. Deep Learning Architectures • Deep Belief Networks – Most common architecture • Convolutional Neural Networks – State of the art in image classification • Recurrent Networks – Timeseries • Recursive Networks – Text / image – Can break down scenes
  • 12. DL4J Next Generation Deep Learning with
  • 13. DL4J • “The Hadoop of Deep Learning” – Command line driven – Java, Scala, and Python APIs – ASF 2.0 Licensed • Java implementation – Parallelization (Yarn, Spark) – GPU support • Also Supports multi-GPU per host • Runtime Neutral – Local – Hadoop / YARN – Spark – AWS • https://github.com/deeplearning4j/deeplearning4j
  • 14. Issues in Machine Learning • Data Gravity – We need to process the data in workflows where the data lives • If you move data you don’t have big data – Even if the data is not “big” we still want simpler workflows • Integration Issues – Ingest, ETL, Vectorization, Modeling, Evaluation, and Deployment issues – Most ML tools are built with previous generation architectures in mind • Legacy Architectures – Parallel iterative algorithm architectures are not common
  • 15. DL4J Suite of Tools • DL4J – Main library for deep learning • Canova – Vectorization library • ND4J – Linear Algebra framework – Swappable backends (JBLAS, GPUs): • http://www.slideshare.net/agibsonccc/future-of-ai-on-the-jvm • Arbiter – Model evaluation and testing platform
  • 16. DEEP LEARNING AND SPARK Enterprise Grade
  • 17. DL4J and Parallelization 17 Model Training Data Worker 1 Master Partial Model Global Model Worker 2 Partial Model Worker N Partial Model Split 1 Split 2 Split 3 … Traditional Serial Training Modern Parallel Engine (Hadoop / Spark)
  • 18. DL4J Spark / GPUs via API public class SparkGpuExample { public static void main(String[] args) throws Exception { Nd4j.MAX_ELEMENTS_PER_SLICE = Integer.MAX_VALUE; Nd4j.MAX_SLICES_TO_PRINT = Integer.MAX_VALUE; // set to test mode SparkConf sparkConf = new SparkConf() .setMaster("local[*]").set(SparkDl4jMultiLayer.AVERAGE_EACH_ITERATION,"false") .set("spark.akka.frameSize", "100") .setAppName("mnist"); System.out.println("Setting up Spark Context..."); JavaSparkContext sc = new JavaSparkContext(sparkConf); MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder() .momentum(0.9).iterations(10) .weightInit(WeightInit.DISTRIBUTION).batchSize(10000) .dist(new NormalDistribution(0, 1)).lossFunction(LossFunctions.LossFunction.RMSE_XENT) .nIn(784).nOut(10).layer(new RBM()) .list(4).hiddenLayerSizes(600, 500, 400) .override(3, new ClassifierOverride()).build(); System.out.println("Initializing network"); SparkDl4jMultiLayer master = new SparkDl4jMultiLayer(sc,conf); DataSet d = new MnistDataSetIterator(60000,60000).next(); List<DataSet> next = d.asList(); JavaRDD<DataSet> data = sc.parallelize(next); MultiLayerNetwork network2 = master.fitDataSet(data); Evaluation evaluation = new Evaluation(); evaluation.eval(d.getLabels(),network2.output(d.getFeatureMatrix())); System.out.println("Averaged once " + evaluation.stats()); INDArray params = network2.params(); Nd4j.writeTxt(params,"params.txt",","); FileUtils.writeStringToFile(new File("conf.json"), network2.getLayerWiseConfigurations().toJson()); } }
  • 19. Turn on GPUs and Spark <dependency> <groupId>org.deeplearning4j</groupId> <artifactId>dl4j-spark</artifactId> <version>${dl4j.version}</version> </dependency> <dependency> <groupId>org.nd4j</groupId> <artifactId>nd4j-jcublas-7.0</artifactId> <version>${nd4j.version}</version> </dependency>
  • 20. Building Deep Learning Workflows • We need to get data from a raw format into a baseline raw vector – Model the data – Evaluate the Model • Traditionally these are all tied together in one tool – But this is a monolithic pattern – We’d like to apply the unix principles here • The DL4J Suite of Tools lets us do this
  • 21. Modeling UCI Data: Iris • We need to vectorize the data – Possibly with some per column transformations – Let’s use Canova • We then need to build a deep learning model over the data – We’ll use the DL4J lib to do this • Finally we’ll evaluate what happened – This is where Arbiter comes in
  • 22. Canova for Command Line Vectorization • Library of tools to take – Audio – Video – Image – Text – CSV data • And convert the input data into vectors in a standardized format – Adaptable with custom input/output formats • Open Source, ASF 2.0 Licensed – https://github.com/deeplearning4j/Canova – Part of DL4J suite
  • 23. Vectorization with Canova • Setup the configuration file – Input Formats – Output Formats – Setup data types to vectorize • Setup the schema transforms for the input CSV data • Generate the SVMLight vector data as the output – with the command line interface
  • 25. Iris Canova Vector Schema @RELATION UCIIrisDataset @DELIMITER , @ATTRIBUTE sepallength NUMERIC !NORMALIZE @ATTRIBUTE sepalwidth NUMERIC !NORMALIZE @ATTRIBUTE petallength NUMERIC !NORMALIZE @ATTRIBUTE petalwidth NUMERIC !NORMALIZE @ATTRIBUTE class STRING !LABEL
  • 26. Model UCI Iris From CLI ./bin/canova vectorize -conf /tmp/iris_conf.txt File path already exists, deleting the old file before proceeding... Output vectors written to: /tmp/iris_svmlight.txt ./bin/dl4j train –conf /tmp/iris_conf.txt [ …log output… ] ./bin/arbiter evaluate –conf /tmp/iris_conf.txt [ …log output… ]
  • 27. Skymind as DL4J Distribution • Just as Redhat was to Linux – A distribution of Linux with enterprise grade packaging • Just as Cloudera/Horton are to Hadoop – A distribution of Apache Hadoop with enterprise grade packaging • Skymind is to DL4J – A distribution of DL4J (+tool suite) with enterprise grade packaging
  • 28. Questions? Thank you for your time and attention “Deep Learning: A Practitioner’s Approach” (Oreilly, October 2015)

Editor's Notes

  • #8: we plot the learned filter for each hidden neuron, one per column of W. Each filter is of the same dimension as the input data, and it is most useful to visualize the filters in the same way as the input data is visualized. In the cases of image patches, we show each filter as an image patch
  • #9: we plot the learned filter for each hidden neuron, one per column of W. Each filter is of the same dimension as the input data, and it is most useful to visualize the filters in the same way as the input data is visualized. In the cases of image patches, we show each filter as an image patch
  • #10: we plot the learned filter for each hidden neuron, one per column of W. Each filter is of the same dimension as the input data, and it is most useful to visualize the filters in the same way as the input data is visualized. In the cases of image patches, we show each filter as an image patch
  • #18: POLR: Parallel Online Logistic Regression Talking points: wanted to start with a known tool to the hadoop community, with expected characteristics Mahout’s SGD is well known, and so we used that as a base point
  • #19: API as early adopter entry point
  • #20: This is how we enable spark execution and gpu integration for the back end Code is slightly different for Spark job Code is same linear algebra, no changes, for math / nd4j impl
  • #21: Next release: we’re expanding the userbase with a CLI front end to the whole thing The domain expert rarely knows how to code Want to make it easier for someone who knows “bash” to get involved (still will need some eng help)