Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep...
Transcript of Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep...
![Page 1: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/1.jpg)
1© 2019 The MathWorks, Inc.
Deep Learning with MATLAB
Giuseppe Ridinò
Senior Application EngineerMathWorks Italy
Cagliari (Italy), 19 Sep. 2019
![Page 2: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/2.jpg)
2
MATLAB & Simulink in Research
![Page 3: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/3.jpg)
3
TNG Data Project and Jupyterlab Interface
Project: http://www.tng-project.org/
Jupyterlab: tng-project.org/data/lab/
Scripts: http://www.tng-
project.org/data/docs/scripts/
![Page 4: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/4.jpg)
4
MATLAB Community Tools for Astronomyhttps://www.mathworks.com/matlabcentral/fileexchange?sort=downloads_desc&q=astronomy
![Page 5: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/5.jpg)
5
LIGO: Spot 1st-Ever Gravitational Waves with MATLAB
Article
Blog post
![Page 6: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/6.jpg)
6
NASA Build Kepler Pipeline tools with MATLABdownload: github.com/nasa/kepler-pipeline
![Page 7: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/7.jpg)
7
Deep Learning Overview
Deep Learning in 6 Lines of MATLAB Code
Deep L e a r n i ng w i t h…
Images Signals
Labeling Ground Truth Data
Working with Other Frameworks
Performance, Deployment, and Next Steps
Agenda
![Page 8: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/8.jpg)
8
Artificial Intelligence
▪ Development of computer systems to perform tasks that
normally require human intelligence
Machine Learning
K-means
Gaussian
Mixture
Logistic
Regression
Decision
Trees
SVM
Nearest
Neighbor
Deep
Learning
Reinforcement Learning
![Page 9: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/9.jpg)
9
Unsupervised
Learning[No Labeled Data]
Clustering
Machine Learning
Machine Learning and Deep Learning
![Page 10: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/10.jpg)
10
Unsupervised
Learning[No Labeled Data]
Supervised Learning
[Labeled Data]
Clustering Classification Regression
Machine Learning
Machine Learning and Deep Learning
![Page 11: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/11.jpg)
11
Unsupervised
Learning[No Labeled Data]
Supervised Learning
[Labeled Data]
Clustering Classification Regression
Machine Learning
Machine Learning and Deep Learning
Deep Learning
Supervised learning typically involves
feature extraction
Deep learning typically does not
involve feature extraction
![Page 12: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/12.jpg)
12
What is Deep Learning?
![Page 13: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/13.jpg)
13
Deep Learning
Deep Learning
Machine
Learning
Deep
Learning
▪ Subset of machine learning with automatic feature extraction
– Learns features and tasks directly from data
– More Data = better model
![Page 14: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/14.jpg)
14
Deep Learning uses a neural network architecture
Input
LayerHidden Layers (n)
Output
Layer
![Page 15: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/15.jpg)
15
Deep Learning datatypes
SignalImage
TextNumeric
![Page 16: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/16.jpg)
16
Example 1: Detection and localization using deep learning
YOLO v2 (You Only Look Once) Semantic Segmentation using SegNet
![Page 17: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/17.jpg)
17
Example 2: Analyzing signal data using deep learning
Signal Classification using LSTMs Speech Recognition using CNNs
![Page 18: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/18.jpg)
18
Machine Learning vs Deep Learning
Deep learning performs end-to-end learning by learning features, representations and tasks directly
from images, text and sound
Deep learning algorithms also scale with data – traditional machine learning saturates
Machine Learning
Deep Learning
![Page 19: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/19.jpg)
19
Deep Learning workflow
Ground truth labeling
PREPARE DATA
Data access and preprocessing
Simulation-based data generation
I Iteration and Refinement
TRAIN MODEL
Model exchange across frameworks
Model design,Hyperparameter tuning
Hardware-accelerated training
DEPLOY SYSTEM
Enterprise Deployment
Embedded deployment
Multiplatform code generation (CPU, GPU)
![Page 20: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/20.jpg)
20
Deep Learning Overview
Deep Learning in 6 Lines of MATLAB Code
Deep L e a r n i ng w i t h…
Images Signals
Labeling Ground Truth Data
Working with Other Frameworks
Performance, Deployment, and Next Steps
Agenda
![Page 21: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/21.jpg)
21
Deep Learning in 6 lines of MATLAB code
![Page 22: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/22.jpg)
22
Using Apps for designing Deep Learning networks
![Page 23: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/23.jpg)
23
Different Neural Networks for Different Data
![Page 24: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/24.jpg)
24
Types of Data
Numeric
Data
Time Series/
Text Data
Image
Data
Machine Learning or
LSTM LSTM or CNNCNN
![Page 25: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/25.jpg)
25
Convolutional Neural Networks (CNN)
ObjectsShapes
Edges
![Page 26: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/26.jpg)
26
CNN Visualization methods
DeepDream ImagesClass ActivationsLayer Activations
![Page 27: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/27.jpg)
27
Another network for signals - LSTM
▪ LSTM = Long Short Term Memory (Networks)
– Signal, text, time-series data
– Use previous data to predict new information
▪ I live in France. I speak ___________.
c0 C1 Ct
![Page 28: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/28.jpg)
28
CNN
CNN
CNN
CNN
LSTM
LSTM
LSTM
LSTM
Class 1
Combining convolution and recurrent layersLearn spatial and temporal features simultaneously
CNN learns features
from each frame
individually
LSTM learns
relationships
between framesVideo Frames
Response
class label
![Page 29: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/29.jpg)
29
Deep Learning Overview
Deep Learning in 6 Lines of MATLAB Code
Deep L e a r n i ng w i t h…
Images Signals
Labeling Ground Truth Data
Working with Other Frameworks
Performance, Deployment, and Next Steps
Agenda
![Page 30: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/30.jpg)
30
Deep Learning Overview
Deep Learning in 6 Lines of MATLAB Code
Deep L e a r n i ng w i t h…
Images Signals
Labeling Ground Truth Data
Working with Other Frameworks
Performance, Deployment, and Next Steps
Agenda
![Page 31: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/31.jpg)
31
Two approaches for Deep Learning
2. Fine-tune a pre-trained model (transfer learning)
1. Train a Deep Neural Network from Scratch
![Page 32: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/32.jpg)
32
Semantic Segmentation
CamVid Dataset1. Segmentation and Recognition Using Structure from Motion Point Clouds, ECCV 2008
2. Semantic Object Classes in Video: A High-Definition Ground Truth Database ,Pattern Recognition Letters
![Page 33: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/33.jpg)
33
Semantic Segmentation Network
Boat
Airplane
Other classes
![Page 34: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/34.jpg)
34
Semantic Segmentation Network
![Page 35: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/35.jpg)
35
Example: Semantic Segmentation for Free Road Detection
![Page 36: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/36.jpg)
36
1. Use CamVid dataset
▪ Download the dataset (images and labels)
▪ Resize images to fit the input sizes of our neural network
![Page 37: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/37.jpg)
37
2. Balance classes using class weighting
Ideally, all classes would have an
equal number of observations.
However, the classes in CamVid are
imbalanced.
We use the pixel label counts and
calculate the median frequency
class weights.
![Page 38: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/38.jpg)
38
3. Split dataset
Training Validation Test
60% 20% 20%
• Trains the model
• Computer “learns”
from this data
• Checks accuracy
of model during
training
• Tests model accuracy
• Not used until validation
accuracy is good
![Page 39: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/39.jpg)
39
4. Define network91x1 Layer array with layers:
1 'inputImage' Image Input 360x480x3 images with 'zerocenter' normalization
2 'conv1_1' Convolution 64 3x3x3 convolutions with stride [1 1] and padding [1 1 1 1]
3 'bn_conv1_1' Batch Normalization Batch normalization
4 'relu1_1' ReLU ReLU
5 'conv1_2' Convolution 64 3x3x64 convolutions with stride [1 1] and padding [1 1 1 1]
6 'bn_conv1_2' Batch Normalization Batch normalization
7 'relu1_2' ReLU ReLU
8 'pool1' Max Pooling 2x2 max pooling with stride [2 2] and padding [0 0 0 0]
9 'conv2_1' Convolution 128 3x3x64 convolutions with stride [1 1] and padding [1 1 1 1]
10 'bn_conv2_1' Batch Normalization Batch normalization
11 'relu2_1' ReLU ReLU
...
Last 9 layers: the last one provides
also the Class Weighting
• Use segnetLayers to create a SegNet network
initialized from a pre-trained VGG-16.
• Another option: Deeplab v3+ network with weights
initialized from a pre-trained Resnet-18.
![Page 40: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/40.jpg)
40
5. Train network
![Page 41: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/41.jpg)
41
Useful tools for Semantic Segmentation
▪ Automatically create network structures
– Using segnetLayers and fcnLayers
▪ Handle pixel labels
– Using the pixelLabelImageDatastore and
pixelLabelDatastore
▪ Evaluate network performance
– Using evaluateSemanticSegmentation
▪ Examples and tutorials to learn concepts
![Page 42: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/42.jpg)
42
Deep Learning Overview
Deep Learning in 6 Lines of MATLAB Code
Deep L e a r n i ng w i t h…
Images Signals
Labeling Ground Truth Data
Working with Other Frameworks
Performance, Deployment, and Next Steps
Agenda
![Page 43: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/43.jpg)
43
Common network architectures - signal processing
Feature Engineering
Time-Frequency Transformation
Convolutional Neural Networks (CNN)
Long Short Term Memory (LSTM) Networks
![Page 44: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/44.jpg)
44
Example: Speech Recognition
![Page 45: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/45.jpg)
45
1. Create Datastore
▪ Datastore creates
reference for data
▪ Do not have to load in
all objects into memory
![Page 46: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/46.jpg)
46
2. Compute speech spectrograms
Am
plit
ude
Fre
quency
Time
![Page 47: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/47.jpg)
47
3. Split datastores
Training Validation Test
70% 15% 15%
• Trains the model
• Computer “learns”
from this data
• Checks accuracy
of model during
training
• Tests model accuracy
• Not used until validation
accuracy is good
![Page 48: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/48.jpg)
48
4. Define architecture and parameters
Neural Network Architecture
Model Parameters
![Page 49: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/49.jpg)
49
5. Train network
![Page 50: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/50.jpg)
50
Training is an iterative process
Parameters adjusted according to performance
![Page 51: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/51.jpg)
51
Deep Learning Overview
Deep Learning in 6 Lines of MATLAB Code
Deep L e a r n i ng w i t h…
Images Signals
Labeling Ground Truth Data
Working with Other Frameworks
Performance, Deployment, and Next Steps
Agenda
![Page 52: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/52.jpg)
52
Labeling for deep learning is repetitive,
tedious, and time-consuming…
but necessary
![Page 53: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/53.jpg)
53
Ground truth labeling for images and video
“How do I label
my data?”
App for
Ground Truth
Labeling
Label regions
and pixels for
semantic
segmentation
![Page 54: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/54.jpg)
54
Ground truth labeling for signals and audio
“How do I label
my data?”
App for Signal
Analysis and
Labeling
Label signal
waveforms,
attributes, and
samples for
machine
learning
![Page 55: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/55.jpg)
55
MATLAB Apps help you speed up labeling work
For labeling images and videos:
1. Image Labeler (Computer Vision Toolbox)
▪ https://www.mathworks.com/help/vision/ref/imagelabeler-app.html
2. Video Labeler (Computer Vision Toolbox)
▪ https://www.mathworks.com/help/vision/ref/videolabeler-app.html
3. Ground Truth Labeler (Automated Driving Toolbox)
▪ https://www.mathworks.com/help/driving/ref/groundtruthlabeler-app.html
How to choose the correct app for your project?
– https://www.mathworks.com/help/vision/ug/choose-a-labeling-app.html
![Page 56: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/56.jpg)
56
MATLAB Apps help you speed up labeling work
For labeling signals and audio:
1. Audio Labeler
(Audio Toolbox)
https://www.mathworks.com/help/audio/ug/au
dio-labeler-walkthrough.html
2. Signal Labeler
(Signal Processing Toolbox)
https://www.mathworks.com/help/signal/ref/si
gnallabeler.html
![Page 57: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/57.jpg)
57
Deep Learning Overview
Deep Learning in 6 Lines of MATLAB Code
Deep L e a r n i ng w i t h…
Images Signals
Labeling Ground Truth Data
Working with Other Frameworks
Performance, Deployment, and Next Steps
Agenda
![Page 58: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/58.jpg)
58
Two ways to work with TensorFlow and PyTorch
Model Exchange
MATLAB Python
Co-execution (Python and C++)
![Page 59: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/59.jpg)
59
Three use cases for model exchange
1. Enable teams to use different frameworks and tools
2. Access to code generation and other downstream tools in MATLAB
3. MATLAB users gain access to models in research/DL ecosystem
![Page 60: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/60.jpg)
60
Model exchange with MATLAB
PyTorch
Caffe2
MXNet
Core ML
CNTK
Keras-
Tensorflow
Caffe
MATLABONNX
Open Neural Network Exchange
(…)
![Page 62: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/62.jpg)
62
Transfer Learning with Pretrained Models
Inception-v3Inception-
ResNet-v2ResNet-18
SqueezeNet ResNet-50
DenseNet-201
VGG-16
AlexNet
GoogLeNet
ResNet-101
VGG-19
Import & Export Models Between Frameworks
Keras-Tensorflow
Importer
Caffe Model
ImporterONNX Model
Converter
More comprehensive list here: https://www.mathworks.com/help/deeplearning/ug/pretrained-convolutional-neural-networks.html
![Page 63: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/63.jpg)
63
Deep Learning Overview
Deep Learning in 6 Lines of MATLAB Code
Deep L e a r n i ng w i t h…
Images Signals
Labeling Ground Truth Data
Working with Other Frameworks
Performance, Deployment, and Next Steps
Agenda
![Page 64: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/64.jpg)
64
Training Performance and Scalability
![Page 65: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/65.jpg)
65
Deep Learning on CPU, GPU, Multi-GPU and Clusters
Single CPU
Single CPUSingle GPU
HOW TO TARGET?
Single CPU, Multiple GPUs
On-prem server with GPUs Cloud GPUs
![Page 66: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/66.jpg)
66
MATLAB parallel capabilities for cloud are evolving
Option Parallel Computing Toolbox MATLAB Parallel Server (formally called MDCS)
Desktop Custom Cloud
Reference
Architecture
User-managed Cloud
Cloud Center
Pre-configured Cloud
Hosting Providers
Custom Cloud
Reference
Architecture
On Premise
Description Explicit desktop
scaling
Explicit desktop
scaling
Preconfigured clusters in
Amazon Web Services
Cloud solutions from
MathWorks partnersCustom infrastructure
for AWS, Azure, and
others
Scale to clusters in your
organization
When to
use
Prototyping, small
scaling
Data in cloud, access
high-end machines,
especially with GPUs
User-centric workflows,
small studies
Managed environments with
operating expense rather
than capital expense
Internally-managed
environments with
operating expense
rather than capital
expense
Traditional scaling on
assets you manage at
your facilities
Maximum
workers
Physical cores in
machine
Physical cores in
machine
1024 per cluster Defined by Hosting Provider No limit Physical cores in cluster
License
Options
• Network
• Online
• Online
• Network (requires
support)
• Online only • Network
• Online• Online
• Network (requires
support)
• Network
• Online
http://www.mathworks.com/programs/mdcs-cloud.html
![Page 67: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/67.jpg)
67
Cloud Reference Architecture: MATLAB & Simulink
Use cases:
• Data analytics on cloud-stored data
• Access to high-end hardware:
− multi-core
− GPUs
− FPGAs
• Prototyping parallel algorithms
• On-server pre-production testing
Remote
Desktop
Client
Virtual Network
![Page 68: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/68.jpg)
68
Reference Architecture: MATLAB Distributed Computing Server
Client with MATLAB and
Parallel Computing Toolbox
Virtual Network
Compute node
VMs
Head node VM
with MATLAB job scheduler
Use cases:
• Parameter sweeps
• Monte Carlo runs
• Optimization
• Distributed array calculations
MathWorks Hosted
License Manager
![Page 69: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/69.jpg)
69
NVIDIA NGC & DGX Supports MATLAB for Deep Learning
▪ GPU-accelerated MATLAB Docker container for deep learning
– Leverage multiple GPUs on NVIDIA DGX Systems and in the Cloud
▪ Cloud providers include: AWS, Azure, Google, Oracle, and Alibaba
▪ NVIDIA DGX System / Station
– Interconnects 4/8/16 Volta GPUs in one box
▪ Containers available for R2018a through R2019a– New Docker container with every major release (a/b)
▪ Download MATLAB container from NGC Registry– https://ngc.nvidia.com/registry/partners-matlab
![Page 70: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/70.jpg)
70
Inference Performance and Deployment
![Page 71: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/71.jpg)
71
Deployment process
Ground truth labeling
PREPARE DATA
Data access and preprocessing
Simulation-based data generation
I Iteration and Refinement
TRAIN MODEL
Model exchange across frameworks
Model design,Hyperparameter tuning
Hardware-accelerated training
DEPLOY SYSTEM
Enterprise Deployment
Edge deployment
Multiplatform code generation (CPU, GPU)
![Page 72: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/72.jpg)
72
Deploying Deep Learning models for inference
Coder
Products
Deep Learning
Networks
NVIDIA
TensorRT &
cuDNN
Libraries
ARM
Compute
Library
Intel
MKL-DNN
Library
GPU Coder
![Page 73: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/73.jpg)
73
Desktop CPU
Raspberry Pi board
Deploying to HW targets
Coder
Products
Deep Learning
Networks
NVIDIA
TensorRT &
cuDNN
Libraries
GPU Coder
![Page 74: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/74.jpg)
74
With GPU Coder, MATLAB is fast
Intel® Xeon® CPU 3.6 GHz - NVIDIA libraries: CUDA10 - cuDNN 7 - Frameworks: TensorFlow 1.13.0, MXNet 1.4.0 PyTorch 1.0.0
GPU Coder is faster
than TensorFlow,
MXNet and PyTorch
TensorFlow
MXNet
GPU Coder
PyTorch
![Page 75: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/75.jpg)
75
Semantic Segmentation speedup
Running in MATLAB Generated Code from GPU Coder
![Page 76: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/76.jpg)
76
Blog: Deep Learning
http://blogs.mathworks.com/deep-learning/
![Page 77: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/77.jpg)
77
Introduction to Deep Learning
http://www.mathworks.com/videos/series/introduction-to-deep-learning.html
![Page 78: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/78.jpg)
78
Deep Learning with MATLAB
http://www.mathworks.com/videos/series/deep-learning-with-MATLAB.html
![Page 79: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/79.jpg)
79
Deep Learning Onramp
http://www.mathworks.com/learn/tutorials/deep-learning-onramp.html
![Page 80: Deep Learning with MATLAB - INAF (Indico)€¦ · NVIDIA NGC & DGX Supports MATLAB for Deep Learning GPU-accelerated MATLAB Docker container for deep learning – Leverage multiple](https://reader033.fdocuments.us/reader033/viewer/2022042307/5ed37bde847f87317f77bec2/html5/thumbnails/80.jpg)
80
Thank you!