SlideShare a Scribd company logo
Using Apache MXNet to Train and Deploy
your Deep Learning model
Qing Lan
PPMC Member of Apache MXNet
T r a c k : M a c h i n e L e a r n i n g
Agenda
• Introduction to Deep Learning
• Introduction to Apache MXNet
• Train your model with MXNet
• Use MXNet for predictions
• Start Learning Apache MXNet
• Apache MXNet: Now and Future
Using MXNet to Train and Deploy your Deep Learning Model
Neural network
Output
layer
Input
layer
Hidden
layers
ManyMore…
• Non-linear
• Hierarchical
feature learning
• Scalable architecture
• Computationally
intensive
Forward pass
Backwards pass
Input Data
Neural
Network
Output
Loss
Back
Propagate
Update
Weights
Forward-backward repeats across multiple epochs, each
epoch goes through the entire training dataset.
Training neural networks
Using MXNet to Train and Deploy your Deep Learning Model
Apache MXNet - Background
● Framework for building, training, and deploying Deep Neural Nets
● Apache (incubating) open source project
● Created by academia (CMU and UW)
● Adopted by AWS as DNN framework of choice, Nov 2016
http://mxnet.apache.org
Using MXNet to Train and Deploy your Deep Learning Model
Apache MXNet for Training
• Simple and Powerful API: Gluon
• Data Science compatibility: Numpy support
• Distributed Training: Horovod, PSLite, BytePS
• Training Speed improvement:
• GPU: CUDNN and Float16 support (NVIDIA AMP)
• CPU: Intel MKLDNN
Current Deep Learning scenario
• Prototype code is hard to maintain
• Setting up baseline for different workloads is hard
• Pre-trained models are hard to obtain
• Models trained in Python cannot be easily deployed to
production system
MXNet Community: Gluon Toolkits
• Carefully designed API for versatile needs
• Implementation for state-of-the-art models
• One-command download of hundreds of pre-trained models
• Easy model export and deployment in C++, Java, Scala with support
for Control flows and model quantization
• Gluon Toolkits
• GluonCV: Computer Vision
• GluonNLP: Natural Language Processing
• GluonTS: Probabilistic Time Series Modeling
• Deep Graph Library
GluonCV: A Vision Toolkit
• Scripts for reproducing SOTA results
• State-of-the-Art pretrained Models
• Easy Deployment
Detection
Pose Est.
Classification Semantic
Segmentation
Instance
Segmentation
GluonNLP: A Natural Language Toolkit
• Data Processing APIs
• Data API, support Multiprocessing, Batching, Vocabulary loading,
Tokenizing…
• Embedding Methods (~500 Pretrained)
• Word2Vec, GloVe, FastText, ELMo, BERT, RoBERTa…
• Sequence Sampler
• Beam Search, Random Sampling
• Models
• Encoder/Decoder, AWD-LSTM, Transformer, Transformer-XL
Using MXNet to Train and Deploy your Deep Learning Model
Apache MXNet for Inference
• Train in one Language, deploy in many:
• JVM: Java, Scala, Clojure
• Other languages: C++, R
• Model support
• Gluon Model Zoo
• Open Neural Network Exchange (ONNX) models
• Keras Model*
• Model Deployment: MXNet Model Server
Gluon Model Zoo
• CV: 194 models
• NLP: 450 models
Multi-Model Server
• Low latency, high throughput
• Language agnostic: Python/Java
• Model loading at runtime
• Serving multiple models
• Highly customizable (use plugins)
Using MXNet to Train and Deploy your Deep Learning Model
How can I make a start?
• Book: Dive into Deep Learning (CHN: 动手学深度学习)
• MXNet Community project
• Comprehensive knowledge to learn Deep Learning
• Include code to practice in MXNet
• Course: STAT 157 Introduction to Deep Learning
• UC Berkerly Spring 2019
• Instructed by Mu Li and Alexander Smola
Apache MXNet: Future plan (2.0)
• Full numpy operator support
• Gluon usability improvement
• Accelerator support
• TVM: operator integration
• TVM: Relay IR integration (Experimental)
Contribute to Apache MXNet
● GitHub: https://github.com/apache/incubator-mxnet
● Subscribe to our developer mailing list:
dev@mxnet.incubator.apache.org
● Slack Channel: https://the-asf.slack.com and go to #mxnet
Thank you!
Qing Lan
PPMC Member of Apache MXNet
lanking@apache.org

More Related Content

PPTX
Tensorflow vs MxNet
PPTX
Scala in practice
PDF
Scala profiling
PDF
Deep learning
PDF
CoreML for NLP (Melb Cocoaheads 08/02/2018)
PDF
Why scala for data science
PDF
AI&BigData Lab 2016. Сарапин Виктор: Размер имеет значение: анализ по требова...
PDF
Machine learning with Apache Spark MLlib | Big Data Hadoop Spark Tutorial | C...
Tensorflow vs MxNet
Scala in practice
Scala profiling
Deep learning
CoreML for NLP (Melb Cocoaheads 08/02/2018)
Why scala for data science
AI&BigData Lab 2016. Сарапин Виктор: Размер имеет значение: анализ по требова...
Machine learning with Apache Spark MLlib | Big Data Hadoop Spark Tutorial | C...

What's hot (20)

PDF
Snakes on a plane - Ship your Python on enterprise machines
ODP
Self driving computers active learning workflows with human interpretable ve...
PDF
Machine Learning for (JVM) Developers
PPTX
Ruby to Scala in 9 weeks
PPTX
NRD: Nagios Result Distributor
PDF
Distributed Deep Learning with Keras and TensorFlow on Apache Spark
PDF
Atlanta Hadoop Users Meetup 09 21 2016
PPTX
AI powered emotion recognition: From Inception to Production - Global AI Conf...
PDF
Apache MXNet AI
PDF
Deconstructiong Recommendations on Spark-(Ilya Ganelin, Capital One)
PPTX
Caffe framework tutorial
PDF
Challenges on Distributed Machine Learning
PDF
Spark Autotuning: Spark Summit East talk by Lawrence Spracklen
PDF
Sînică Alboaie - Programming for cloud computing Flows of asynchronous messages
PDF
running Tensorflow in Production
PDF
Best Practices for Hyperparameter Tuning with MLflow
PDF
Apache MXNet ODSC West 2018
PDF
Lessons Learned while Implementing a Sparse Logistic Regression Algorithm in ...
PPTX
Large Scale Machine learning with Spark
PDF
SciPy 2019: How to Accelerate an Existing Codebase with Numba
Snakes on a plane - Ship your Python on enterprise machines
Self driving computers active learning workflows with human interpretable ve...
Machine Learning for (JVM) Developers
Ruby to Scala in 9 weeks
NRD: Nagios Result Distributor
Distributed Deep Learning with Keras and TensorFlow on Apache Spark
Atlanta Hadoop Users Meetup 09 21 2016
AI powered emotion recognition: From Inception to Production - Global AI Conf...
Apache MXNet AI
Deconstructiong Recommendations on Spark-(Ilya Ganelin, Capital One)
Caffe framework tutorial
Challenges on Distributed Machine Learning
Spark Autotuning: Spark Summit East talk by Lawrence Spracklen
Sînică Alboaie - Programming for cloud computing Flows of asynchronous messages
running Tensorflow in Production
Best Practices for Hyperparameter Tuning with MLflow
Apache MXNet ODSC West 2018
Lessons Learned while Implementing a Sparse Logistic Regression Algorithm in ...
Large Scale Machine learning with Spark
SciPy 2019: How to Accelerate an Existing Codebase with Numba
Ad

Similar to Using MXNet to Train and Deploy your Deep Learning Model (20)

PDF
New Developments in H2O: April 2017 Edition
PPTX
Amazon Deep Learning
PDF
Deep Learning with Apache MXNet
PDF
Scalable Deep Learning on AWS with Apache MXNet
PDF
DeepLearning001&ApacheMXNetWithSparkForInference-ACNA2018
PDF
Neptune @ SoCal
PDF
Building Large Scale Machine Learning Applications with Pipelines-(Evan Spark...
PDF
ApacheCon 2021 Apache Deep Learning 302
PDF
CI-Keras for deep learning by adrian.pdf
PPTX
2018 03 25 system ml ai and openpower meetup
PDF
Guglielmo iozzia - Google I/O extended dublin 2018
PPTX
AI and Spark - IBM Community AI Day
PDF
Introduction to keras
PDF
Scalable Deep Learning on AWS using Apache MXNet (May 2017)
PPTX
Overview of PaaS: Java experience
PPTX
Overview of PaaS: Java experience
PPTX
Suneel Marthi - Deep Learning with Apache Flink and DL4J
PPTX
Scala and Spark are Ideal for Big Data
PDF
Deep Dive into Apache MXNet on AWS
PPTX
Enterprise Deep Learning with DL4J
New Developments in H2O: April 2017 Edition
Amazon Deep Learning
Deep Learning with Apache MXNet
Scalable Deep Learning on AWS with Apache MXNet
DeepLearning001&ApacheMXNetWithSparkForInference-ACNA2018
Neptune @ SoCal
Building Large Scale Machine Learning Applications with Pipelines-(Evan Spark...
ApacheCon 2021 Apache Deep Learning 302
CI-Keras for deep learning by adrian.pdf
2018 03 25 system ml ai and openpower meetup
Guglielmo iozzia - Google I/O extended dublin 2018
AI and Spark - IBM Community AI Day
Introduction to keras
Scalable Deep Learning on AWS using Apache MXNet (May 2017)
Overview of PaaS: Java experience
Overview of PaaS: Java experience
Suneel Marthi - Deep Learning with Apache Flink and DL4J
Scala and Spark are Ideal for Big Data
Deep Dive into Apache MXNet on AWS
Enterprise Deep Learning with DL4J
Ad

Recently uploaded (20)

PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
PPT on Performance Review to get promotions
PPTX
Safety Seminar civil to be ensured for safe working.
PPTX
Current and future trends in Computer Vision.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Construction Project Organization Group 2.pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Well-logging-methods_new................
PDF
R24 SURVEYING LAB MANUAL for civil enggi
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
bas. eng. economics group 4 presentation 1.pptx
CYBER-CRIMES AND SECURITY A guide to understanding
PPT on Performance Review to get promotions
Safety Seminar civil to be ensured for safe working.
Current and future trends in Computer Vision.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Foundation to blockchain - A guide to Blockchain Tech
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Construction Project Organization Group 2.pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Well-logging-methods_new................
R24 SURVEYING LAB MANUAL for civil enggi
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf

Using MXNet to Train and Deploy your Deep Learning Model

  • 1. Using Apache MXNet to Train and Deploy your Deep Learning model Qing Lan PPMC Member of Apache MXNet T r a c k : M a c h i n e L e a r n i n g
  • 2. Agenda • Introduction to Deep Learning • Introduction to Apache MXNet • Train your model with MXNet • Use MXNet for predictions • Start Learning Apache MXNet • Apache MXNet: Now and Future
  • 4. Neural network Output layer Input layer Hidden layers ManyMore… • Non-linear • Hierarchical feature learning • Scalable architecture • Computationally intensive
  • 5. Forward pass Backwards pass Input Data Neural Network Output Loss Back Propagate Update Weights Forward-backward repeats across multiple epochs, each epoch goes through the entire training dataset. Training neural networks
  • 7. Apache MXNet - Background ● Framework for building, training, and deploying Deep Neural Nets ● Apache (incubating) open source project ● Created by academia (CMU and UW) ● Adopted by AWS as DNN framework of choice, Nov 2016 http://mxnet.apache.org
  • 9. Apache MXNet for Training • Simple and Powerful API: Gluon • Data Science compatibility: Numpy support • Distributed Training: Horovod, PSLite, BytePS • Training Speed improvement: • GPU: CUDNN and Float16 support (NVIDIA AMP) • CPU: Intel MKLDNN
  • 10. Current Deep Learning scenario • Prototype code is hard to maintain • Setting up baseline for different workloads is hard • Pre-trained models are hard to obtain • Models trained in Python cannot be easily deployed to production system
  • 11. MXNet Community: Gluon Toolkits • Carefully designed API for versatile needs • Implementation for state-of-the-art models • One-command download of hundreds of pre-trained models • Easy model export and deployment in C++, Java, Scala with support for Control flows and model quantization • Gluon Toolkits • GluonCV: Computer Vision • GluonNLP: Natural Language Processing • GluonTS: Probabilistic Time Series Modeling • Deep Graph Library
  • 12. GluonCV: A Vision Toolkit • Scripts for reproducing SOTA results • State-of-the-Art pretrained Models • Easy Deployment Detection Pose Est. Classification Semantic Segmentation Instance Segmentation
  • 13. GluonNLP: A Natural Language Toolkit • Data Processing APIs • Data API, support Multiprocessing, Batching, Vocabulary loading, Tokenizing… • Embedding Methods (~500 Pretrained) • Word2Vec, GloVe, FastText, ELMo, BERT, RoBERTa… • Sequence Sampler • Beam Search, Random Sampling • Models • Encoder/Decoder, AWD-LSTM, Transformer, Transformer-XL
  • 15. Apache MXNet for Inference • Train in one Language, deploy in many: • JVM: Java, Scala, Clojure • Other languages: C++, R • Model support • Gluon Model Zoo • Open Neural Network Exchange (ONNX) models • Keras Model* • Model Deployment: MXNet Model Server
  • 16. Gluon Model Zoo • CV: 194 models • NLP: 450 models
  • 17. Multi-Model Server • Low latency, high throughput • Language agnostic: Python/Java • Model loading at runtime • Serving multiple models • Highly customizable (use plugins)
  • 19. How can I make a start? • Book: Dive into Deep Learning (CHN: 动手学深度学习) • MXNet Community project • Comprehensive knowledge to learn Deep Learning • Include code to practice in MXNet • Course: STAT 157 Introduction to Deep Learning • UC Berkerly Spring 2019 • Instructed by Mu Li and Alexander Smola
  • 20. Apache MXNet: Future plan (2.0) • Full numpy operator support • Gluon usability improvement • Accelerator support • TVM: operator integration • TVM: Relay IR integration (Experimental)
  • 21. Contribute to Apache MXNet ● GitHub: https://github.com/apache/incubator-mxnet ● Subscribe to our developer mailing list: dev@mxnet.incubator.apache.org ● Slack Channel: https://the-asf.slack.com and go to #mxnet
  • 22. Thank you! Qing Lan PPMC Member of Apache MXNet lanking@apache.org

Editor's Notes

  • #5: Neural networks are composed of neurons. The neurons are organized into layers. There’s the input layer, the output layer, and in between is what we refer to as the hidden layers. If there are ”many” hidden layers, we call the network deep. Hence the term Deep Learning. Since the neurons in the network have a non-linear activation function, the whole network is non-linear and able to approximate complex functions. Able to learn hierarchical features about the data Scalable architecture. You can increase the number of layers. Increase the number of neurons in a layer… But this gets computationally expensive.
  • #6: The difficult part is training the network, so we can find the right weights that will approximate the function modeling the problem we are trying to solve. We start with the “Forward Pass”, in which we take a sample from our labeled input data, feed it through the network to get the inference, or prediction result. We then do the “Backwards Pass”, also called “Backprop”, where we calculate the loss, i.e. how bad did the network did compared to the “Ground Truth” – the label of the sample input data – and then we back propagate the loss across the network, finding the gradients of each weight to identify the direction of the error. We then update the weights across the network, in a direction opposite to the gradient, and in a value that is typically a fraction of the gradient – this fraction is called the “Learning Rate”. The Backwards Pass is where learning happens. Through repeated iterations, we are leveraging the gradient to take down the loss, until we converge into a low error rate. After we’ve finished training the model, we no longer do the backwards pass. Instead we do only the forward pass to make predictions. We refer to this process as inference.
  • #8: Just a bit of background on MXNet: MXNet is a deep learning framework for building, training, and deploying Deep Neural Nets. This last part, deploying DNNs, is probably the most interesting to you and what we’ll be focusing on today. MXNet is an Apache project. This means that no one group or company controls the project. Decisions about the direction of MXNet are made by the MXNet community. It originated in the academia, CMU and UW Aws adopted MXNet late 2016 as “DL FW of choice), there’s a nice blog post by AWS CTO (Vogels) explaining more in details. A lot of it is about scalability and MXNet being good for production use.
  • #13: Reproducing state of art result are hard. We give you the sauce needed to do that 100+ SOTA pretrained models. Export model run on python/C++ We maintain the brazil package.
  • #21: TVM operators