SlideShare a Scribd company logo
1 of 23
Download to read offline
©2017,	Amazon	Web	Services,	Inc.	or	its	affiliates.	All	rights	reserved
Deep Learning for Developers
Julien Simon <@julsimon>
Principal Evangelist, AI/ML, EMEA
Amazon AI for every developer
The Nvidia V100 GPU is now available on AWS
Launched October 25th
https://aws.amazon.com/blogs/aws/new-amazon-ec2-instances-with-up-to-8-nvidia-tesla-v100-gpus-p3/
https://devblogs.nvidia.com/parallelforall/inside-volta/
MNIST on 1 GPU:
2x speedup vs p2
Apache MXNet: Open Source library for Deep Learning
Programmable Portable High Performance
Near linear scaling
across hundreds of
GPUs
Highly efficient
models for mobile
and IoT
Simple syntax,
multiple languages
Most Open Best On AWS
Optimized for
Deep Learning on AWS
Accepted into the
Apache Incubator
https://mxnet.io
https://www.oreilly.com/ideas/self-driving-trucks-enter-the-fast-lane-using-deep-learning
Last June, tuSimple drove an autonomous truck
for 200 miles from Yuma, AZ to San Diego, CA
Input Output
1 1 1
1 0 1
0 0 0
3
mx.sym.Convolution(data, kernel=(5,5), num_filter=20)
mx.sym.Pooling(data, pool_type="max", kernel=(2,2),
stride=(2,2)
lstm.lstm_unroll(num_lstm_layer, seq_len, len, num_hidden, num_embed)
4 2
2 0
4=Max
1
3
...
4
0.2
-0.1
...
0.7
mx.sym.FullyConnected(data, num_hidden=128)
2
mx.symbol.Embedding(data, input_dim, output_dim = k)
0.2
-0.1
...
0.7
Queen
4 2
2 0
2=Avg
Input Weights
cos(w, queen) = cos(w, king) - cos(w, man) + cos(w, woman)
mx.sym.Activation(data, act_type="xxxx")
"relu"
"tanh"
"sigmoid"
"softrelu"
Neural Art
Face Search
Image Segmentation
Image Caption
“People Riding
Bikes”
Bicycle, People,
Road, Sport
Image Labels
Image
Video
Speech
Text
“People Riding
Bikes”
Machine Translation
“Οι άνθρωποι
ιππασίας ποδήλατα”
Events
mx.model.FeedForward model.fit
mx.sym.SoftmaxOutput
CPU or GPU: your choice
mod = mx.mod.Module(lenet)
mod = mx.mod.Module(lenet, context=mx.gpu(0))
mod = mx.mod.Module(lenet,
context=(mx.gpu(7), mx.gpu(8), mx.gpu(9)))
Ideal
Inception v3
Resnet
Alexnet
88%
Efficiency
0
64
128
192
256
1 2 4 8 16 32 64 128 256
Multi-GPU Scaling With MXNet
AWS Deep Learning AMI
• Deep Learning Frameworks – Popular Deep Learning
Frameworks (MXNet, Caffe, Tensorflow, Theano, Torch,
etc.) all prebuilt and pre-installed
• GPU components – Nvidia drivers, cuDNN, CUDA 8 & 9
• AWS Integration – Packages and configurations that
provide tight integration with Amazon Web Services
• Amazon Linux & Ubuntu
https://aws.amazon.com/blogs/ai/announcing-new-aws-deep-learning-ami-for-amazon-ec2-p3-instances/
Apache MXNet demos
1. Image classification: using pre-trained models
Imagenet, multiple CNNs, MXNet
2. Image classification: fine-tuning a pre-trained model
CIFAR-10, ResNet-50, Keras + MXNet
3. Image classification: learning from scratch
MNIST, MLP & LeNet, MXNet
4. Machine Translation: translating German to English
News, LSTM, Sockeye + MXNet
Demo #1 – Image classification: using a pre-trained model
*** VGG16
[(0.46811387, 'n04296562 stage'), (0.24333163,
'n03272010 electric guitar'), (0.045918692, 'n02231487
walking stick, walkingstick, stick insect'),
(0.03316205, 'n04286575 spotlight, spot'),
(0.021694135, 'n03691459 loudspeaker, speaker, speaker
unit, loudspeaker system, speaker system')]
*** ResNet-152
[(0.8726753, 'n04296562 stage'), (0.046159592,
'n03272010 electric guitar'), (0.041658506, 'n03759954
microphone, mike'), (0.018624334, 'n04286575
spotlight, spot'), (0.0058045341, 'n02676566 acoustic
guitar')]
*** Inception v3
[(0.44991142, 'n04296562 stage'), (0.43065304,
'n03272010 electric guitar'), (0.067580454, 'n04456115
torch'), (0.012423956, 'n02676566 acoustic guitar'),
(0.0093934005, 'n03250847 drumstick')]
https://medium.com/@julsimon/an-introduction-to-the-mxnet-api-part-5-9e78534096db
Demo #2 – Image classification: fine-tuning a model
• CIFAR-10 data set
– 60,000 images in 10 classes
– 32x32 color images
• Initial training
– Resnet-50 CNN
– 200 epochs
– 82.12% validation
• Cars vs. horses
– 88.8% validation accuracy
https://medium.com/@julsimon/keras-shoot-out-part-3-fine-tuning-7d1548c51a41
Demo #2 – Image classification: fine-tuning a model
• Freezing all layers but the last one
• Fine-tuning on « cars vs. horses » for 10 epochs
• 2 minutes on 1 GPU
• 98.8% validation accuracy
Epoch 10/10
10000/10000 [==============================] - 12s
loss: 1.6989 - acc: 0.9994 - val_loss: 1.7490 - val_acc: 0.9880
2000/2000 [==============================] - 2s
[1.7490020694732666, 0.98799999999999999]
Demo #3 – Image classification: learning from scratch
• MNIST data set
• 70,000 hand-written digits
• 28x28 grayscale images
https://medium.com/@julsimon/training-mxnet-part-1-mnist-6f0dc4210c62
Multi-Layer Perceptron vs. Handmade-Digits-From-Hell™
784/128/64/10, Relu, AdaGrad, 100 epochs à 97.51% validation accuracy
[[ 0.839 0.034 0.039 0.009 0. 0.008 0.066 0.002 0. 0.004]]
[[ 0. 0.988 0.001 0.003 0.001 0.001 0.002 0.003 0.001 0.002]]
[[ 0.006 0.01 0.95 0.029 0. 0.001 0.004 0. 0. 0.]]
[[ 0. 0. 0. 1. 0. 0. 0. 0. 0. 0.]]
[[ 0. 0.001 0.005 0.001 0.982 0.001 0. 0.007 0. 0.002]]
[[ 0.001 0.001 0. 0.078 0. 0.911 0.01 0. 0. 0.]]
[[ 0.003 0. 0.019 0. 0.005 0.004 0.863 0. 0.105 0.001]]
[[ 0.001 0.008 0.098 0.033 0. 0. 0. 0.852 0.004 0.004]]
[[ 0.001 0. 0.006 0. 0. 0.001 0.002 0. 0.991 0.]]
[[ 0.002 0.158 0.007 0.117 0.082 0.001 0. 0.239 0.17 0.224]]
LeNet CNN vs. Handmade-Digits-From-Hell™
ReLu instead of tanh, 10 epochs, AdaGrad à 99.20% validation accuracy
[[ 1. 0. 0. 0. 0. 0. 0. 0. 0. 0.]]
[[ 0. 1. 0. 0. 0. 0. 0. 0. 0. 0.]]
[[ 0. 0. 1. 0. 0. 0. 0. 0. 0. 0.]]
[[ 0. 0. 0. 1. 0. 0. 0. 0. 0. 0.]]
[[ 0. 0. 0.001 0. 0.998 0. 0. 0.001 0. 0.]]
[[ 0. 0. 0. 0. 0. 1. 0. 0. 0. 0.]]
[[ 0. 0. 0. 0. 0. 0. 1. 0. 0. 0.]]
[[ 0. 0. 0. 0.001 0. 0. 0. 0.999 0. 0.]]
[[ 0. 0. 0.006 0. 0. 0. 0. 0. 0.994 0.]]
[[ 0. 0. 0. 0.001 0.001 0. 0. 0.001 0.001 0.996]]
Demo #4 – Machine Translation: German to English
• AWS Open Source project https://github.com/awslabs/sockeye
• Sequence-to-sequence models with Apache MXNet
• 5.8M sentences (news headlines), 5 hours of training on 8 GPUs (p2)
./translate.sh "Chopin zählt zu den bedeutendsten Persönlichkeiten der
Musikgeschichte Polens .”
Chopin is one of the most important personalities of Poland’s history
./translate.sh "Hotelbetreiber müssen künftig nur den Rundfunkbeitrag bezahlen,
wenn ihre Zimmer auch eine Empfangsmöglichkeit bieten .”
in the future , hotel operators must pay only the broadcasting fee if their rooms
also offer a reception facility .
https://aws.amazon.com/blogs/ai/train-neural-machine-translation-models-with-sockeye/
Speeding up inference on CPU
• Intel MKL https://software.intel.com/en-us/mkl
• NNPACK https://github.com/Maratyszcza/NNPACK
https://medium.com/@julsimon/speeding-up-apache-mxnet-with-the-nnpack-library-7427f367490f
https://medium.com/@julsimon/speeding-up-apache-mxnet-with-the-nnpack-library-raspberry-pi-edition-e444b446a180
Shrinking models
• Complex neural networks are too large for resource-constrained environments
• MXNet supports Mixed Precision Training
• Use float16 instead of float32
• Almost 2x reduction in memory consumption, no loss of accuracy
• https://devblogs.nvidia.com/parallelforall/mixed-precision-training-deep-neural-networks/
• http://docs.nvidia.com/deeplearning/sdk/mixed-precision-training/index.html#mxnet
• BMXNet: Binary Neural Network Implementation
• Use binary values
• 20x to 30x reduction in model size, with limited loss
• https://github.com/hpi-xnor/BMXNet
Gluon: Deep Learning gets even easier
https://github.com/gluon-api/
• Announced October 11th
• Available now in MXNet, soon in Microsoft Cognitive Toolkit
• Developer-friendly high-level API
• No compromise on performance
• Networks can be modified during training
• Extensive model zoo
https://aws.amazon.com/blogs/aws/introducing-gluon-a-new-library-for-machine-learning-from-aws-and-microsoft/
https://mxnet.incubator.apache.org/versions/master/api/python/gluon/model_zoo.html
Anything you dream is fiction, and anything you
accomplish is science, the whole history of
mankind is nothing but science fiction.
Ray Bradbury
Resources
https://aws.amazon.com/ai/
https://aws.amazon.com/blogs/ai/
https://mxnet.io
https://github.com/gluon-api/
https://github.com/awslabs/sockeye
https://reinvent.awsevents.com/ watch this space ;)
https://medium.com/@julsimon/
Thank you!
https://aws.amazon.com/evangelists/julien-simon
@julsimon

More Related Content

What's hot

Systems Bioinformatics Workshop Keynote
Systems Bioinformatics Workshop KeynoteSystems Bioinformatics Workshop Keynote
Systems Bioinformatics Workshop Keynote
Deepak Singh
 

What's hot (20)

Cloud Talk
Cloud TalkCloud Talk
Cloud Talk
 
Deep Learning for Developers
Deep Learning for DevelopersDeep Learning for Developers
Deep Learning for Developers
 
Deep Learning for Developers (expanded version, 12/2017)
Deep Learning for Developers (expanded version, 12/2017)Deep Learning for Developers (expanded version, 12/2017)
Deep Learning for Developers (expanded version, 12/2017)
 
Optimizing training on Apache MXNet
Optimizing training on Apache MXNetOptimizing training on Apache MXNet
Optimizing training on Apache MXNet
 
Processing images with Deep Learning
Processing images with Deep LearningProcessing images with Deep Learning
Processing images with Deep Learning
 
Deep Learning with Apache MXNet
Deep Learning with Apache MXNetDeep Learning with Apache MXNet
Deep Learning with Apache MXNet
 
MCL333_Building Deep Learning Applications with TensorFlow on AWS
MCL333_Building Deep Learning Applications with TensorFlow on AWSMCL333_Building Deep Learning Applications with TensorFlow on AWS
MCL333_Building Deep Learning Applications with TensorFlow on AWS
 
Deep Learning for Developers (January 2018)
Deep Learning for Developers (January 2018)Deep Learning for Developers (January 2018)
Deep Learning for Developers (January 2018)
 
Machine Learning in Action
Machine Learning in ActionMachine Learning in Action
Machine Learning in Action
 
Amazon ec2
Amazon ec2Amazon ec2
Amazon ec2
 
Systems Bioinformatics Workshop Keynote
Systems Bioinformatics Workshop KeynoteSystems Bioinformatics Workshop Keynote
Systems Bioinformatics Workshop Keynote
 
AWS EC2
AWS EC2AWS EC2
AWS EC2
 
Deep Dive on Amazon EC2 Instances (March 2017)
Deep Dive on Amazon EC2 Instances (March 2017)Deep Dive on Amazon EC2 Instances (March 2017)
Deep Dive on Amazon EC2 Instances (March 2017)
 
(GAM303) Beyond Game Servers: Load Testing, Rendering, and Cloud Gaming | AWS...
(GAM303) Beyond Game Servers: Load Testing, Rendering, and Cloud Gaming | AWS...(GAM303) Beyond Game Servers: Load Testing, Rendering, and Cloud Gaming | AWS...
(GAM303) Beyond Game Servers: Load Testing, Rendering, and Cloud Gaming | AWS...
 
Picking the right AWS backend for your Java application
Picking the right AWS backend for your Java applicationPicking the right AWS backend for your Java application
Picking the right AWS backend for your Java application
 
Getting Cloudy with Remote Graphics and GPU Compute Using G2 instances (CPN21...
Getting Cloudy with Remote Graphics and GPU Compute Using G2 instances (CPN21...Getting Cloudy with Remote Graphics and GPU Compute Using G2 instances (CPN21...
Getting Cloudy with Remote Graphics and GPU Compute Using G2 instances (CPN21...
 
Deep Dive on Amazon EC2
Deep Dive on Amazon EC2Deep Dive on Amazon EC2
Deep Dive on Amazon EC2
 
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017
 
Deep Learning을 위한 AWS 기반 인공 지능(AI) 서비스 (윤석찬)
Deep Learning을 위한  AWS 기반 인공 지능(AI) 서비스 (윤석찬)Deep Learning을 위한  AWS 기반 인공 지능(AI) 서비스 (윤석찬)
Deep Learning을 위한 AWS 기반 인공 지능(AI) 서비스 (윤석찬)
 
The Future is Now: Leveraging the Cloud with Ruby
The Future is Now: Leveraging the Cloud with RubyThe Future is Now: Leveraging the Cloud with Ruby
The Future is Now: Leveraging the Cloud with Ruby
 

Similar to Deep Learning for Developers (October 2017)

Deep Dive on Deep Learning with MXNet - DevDay Austin 2017
Deep Dive on Deep Learning with MXNet - DevDay Austin 2017Deep Dive on Deep Learning with MXNet - DevDay Austin 2017
Deep Dive on Deep Learning with MXNet - DevDay Austin 2017
Amazon Web Services
 

Similar to Deep Learning for Developers (October 2017) (20)

An Introduction to Deep Learning with Apache MXNet (November 2017)
An Introduction to Deep Learning with Apache MXNet (November 2017)An Introduction to Deep Learning with Apache MXNet (November 2017)
An Introduction to Deep Learning with Apache MXNet (November 2017)
 
An introduction to Deep Learning with Apache MXNet (November 2017)
An introduction to Deep Learning with Apache MXNet (November 2017)An introduction to Deep Learning with Apache MXNet (November 2017)
An introduction to Deep Learning with Apache MXNet (November 2017)
 
soft-shake.ch - Optimizing iOS applications
soft-shake.ch - Optimizing iOS applicationssoft-shake.ch - Optimizing iOS applications
soft-shake.ch - Optimizing iOS applications
 
Brighttalk: SUSE Lösungen für die Public Cloud
Brighttalk: SUSE Lösungen für die Public CloudBrighttalk: SUSE Lösungen für die Public Cloud
Brighttalk: SUSE Lösungen für die Public Cloud
 
Openstack Summit Tokyo 2015 - Building a private cloud to efficiently handle ...
Openstack Summit Tokyo 2015 - Building a private cloud to efficiently handle ...Openstack Summit Tokyo 2015 - Building a private cloud to efficiently handle ...
Openstack Summit Tokyo 2015 - Building a private cloud to efficiently handle ...
 
Rapid Prototyping with AWS IoT and Mongoose OS on ESP8266, ESP32, and CC3200 ...
Rapid Prototyping with AWS IoT and Mongoose OS on ESP8266, ESP32, and CC3200 ...Rapid Prototyping with AWS IoT and Mongoose OS on ESP8266, ESP32, and CC3200 ...
Rapid Prototyping with AWS IoT and Mongoose OS on ESP8266, ESP32, and CC3200 ...
 
Minikube – get Connections in the smalles possible setup
Minikube – get Connections in the smalles possible setupMinikube – get Connections in the smalles possible setup
Minikube – get Connections in the smalles possible setup
 
AWS IoT with ESP32 and Mongoose OS
AWS IoT with ESP32 and Mongoose OSAWS IoT with ESP32 and Mongoose OS
AWS IoT with ESP32 and Mongoose OS
 
Open source technologies in Microsoft cloud
Open source technologies in Microsoft cloudOpen source technologies in Microsoft cloud
Open source technologies in Microsoft cloud
 
Deep Dive on Deep Learning with MXNet - DevDay Austin 2017
Deep Dive on Deep Learning with MXNet - DevDay Austin 2017Deep Dive on Deep Learning with MXNet - DevDay Austin 2017
Deep Dive on Deep Learning with MXNet - DevDay Austin 2017
 
OpenStack and Puppet
OpenStack and PuppetOpenStack and Puppet
OpenStack and Puppet
 
"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019
"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019
"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019
 
cloud conference 2013 - Infrastructure as a Service in Amazon Web Services
cloud conference 2013 - Infrastructure as a Service in Amazon Web Servicescloud conference 2013 - Infrastructure as a Service in Amazon Web Services
cloud conference 2013 - Infrastructure as a Service in Amazon Web Services
 
T-Mobile and Elastic
T-Mobile and ElasticT-Mobile and Elastic
T-Mobile and Elastic
 
Meetup web scale architecture quantum computing (Part 1 16-10-2018)
Meetup web scale architecture quantum computing (Part 1 16-10-2018)Meetup web scale architecture quantum computing (Part 1 16-10-2018)
Meetup web scale architecture quantum computing (Part 1 16-10-2018)
 
CloudStack EU user group - CloudStack news
CloudStack EU user group - CloudStack newsCloudStack EU user group - CloudStack news
CloudStack EU user group - CloudStack news
 
Cracking the nut, solving edge ai with apache tools and frameworks
Cracking the nut, solving edge ai with apache tools and frameworksCracking the nut, solving edge ai with apache tools and frameworks
Cracking the nut, solving edge ai with apache tools and frameworks
 
Introduction and news
Introduction and newsIntroduction and news
Introduction and news
 
아마존의 딥러닝 기술 활용 사례 - 윤석찬 (AWS 테크니컬 에반젤리스트)
아마존의 딥러닝 기술 활용 사례 - 윤석찬 (AWS 테크니컬 에반젤리스트)아마존의 딥러닝 기술 활용 사례 - 윤석찬 (AWS 테크니컬 에반젤리스트)
아마존의 딥러닝 기술 활용 사례 - 윤석찬 (AWS 테크니컬 에반젤리스트)
 
AWS re:Invent 2016: Deep Learning at Cloud Scale: Improving Video Discoverabi...
AWS re:Invent 2016: Deep Learning at Cloud Scale: Improving Video Discoverabi...AWS re:Invent 2016: Deep Learning at Cloud Scale: Improving Video Discoverabi...
AWS re:Invent 2016: Deep Learning at Cloud Scale: Improving Video Discoverabi...
 

More from Julien SIMON

More from Julien SIMON (20)

An introduction to computer vision with Hugging Face
An introduction to computer vision with Hugging FaceAn introduction to computer vision with Hugging Face
An introduction to computer vision with Hugging Face
 
Reinventing Deep Learning
 with Hugging Face Transformers
Reinventing Deep Learning
 with Hugging Face TransformersReinventing Deep Learning
 with Hugging Face Transformers
Reinventing Deep Learning
 with Hugging Face Transformers
 
Building NLP applications with Transformers
Building NLP applications with TransformersBuilding NLP applications with Transformers
Building NLP applications with Transformers
 
Building Machine Learning Models Automatically (June 2020)
Building Machine Learning Models Automatically (June 2020)Building Machine Learning Models Automatically (June 2020)
Building Machine Learning Models Automatically (June 2020)
 
Starting your AI/ML project right (May 2020)
Starting your AI/ML project right (May 2020)Starting your AI/ML project right (May 2020)
Starting your AI/ML project right (May 2020)
 
Scale Machine Learning from zero to millions of users (April 2020)
Scale Machine Learning from zero to millions of users (April 2020)Scale Machine Learning from zero to millions of users (April 2020)
Scale Machine Learning from zero to millions of users (April 2020)
 
An Introduction to Generative Adversarial Networks (April 2020)
An Introduction to Generative Adversarial Networks (April 2020)An Introduction to Generative Adversarial Networks (April 2020)
An Introduction to Generative Adversarial Networks (April 2020)
 
AIM410R1 Deep learning applications with TensorFlow, featuring Fannie Mae (De...
AIM410R1 Deep learning applications with TensorFlow, featuring Fannie Mae (De...AIM410R1 Deep learning applications with TensorFlow, featuring Fannie Mae (De...
AIM410R1 Deep learning applications with TensorFlow, featuring Fannie Mae (De...
 
AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)
AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)
AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)
 
AIM410R Deep Learning Applications with TensorFlow, featuring Mobileye (Decem...
AIM410R Deep Learning Applications with TensorFlow, featuring Mobileye (Decem...AIM410R Deep Learning Applications with TensorFlow, featuring Mobileye (Decem...
AIM410R Deep Learning Applications with TensorFlow, featuring Mobileye (Decem...
 
A pragmatic introduction to natural language processing models (October 2019)
A pragmatic introduction to natural language processing models (October 2019)A pragmatic introduction to natural language processing models (October 2019)
A pragmatic introduction to natural language processing models (October 2019)
 
Building smart applications with AWS AI services (October 2019)
Building smart applications with AWS AI services (October 2019)Building smart applications with AWS AI services (October 2019)
Building smart applications with AWS AI services (October 2019)
 
Build, train and deploy ML models with SageMaker (October 2019)
Build, train and deploy ML models with SageMaker (October 2019)Build, train and deploy ML models with SageMaker (October 2019)
Build, train and deploy ML models with SageMaker (October 2019)
 
The Future of AI (September 2019)
The Future of AI (September 2019)The Future of AI (September 2019)
The Future of AI (September 2019)
 
Building Machine Learning Inference Pipelines at Scale (July 2019)
Building Machine Learning Inference Pipelines at Scale (July 2019)Building Machine Learning Inference Pipelines at Scale (July 2019)
Building Machine Learning Inference Pipelines at Scale (July 2019)
 
Train and Deploy Machine Learning Workloads with AWS Container Services (July...
Train and Deploy Machine Learning Workloads with AWS Container Services (July...Train and Deploy Machine Learning Workloads with AWS Container Services (July...
Train and Deploy Machine Learning Workloads with AWS Container Services (July...
 
Optimize your Machine Learning Workloads on AWS (July 2019)
Optimize your Machine Learning Workloads on AWS (July 2019)Optimize your Machine Learning Workloads on AWS (July 2019)
Optimize your Machine Learning Workloads on AWS (July 2019)
 
Deep Learning on Amazon Sagemaker (July 2019)
Deep Learning on Amazon Sagemaker (July 2019)Deep Learning on Amazon Sagemaker (July 2019)
Deep Learning on Amazon Sagemaker (July 2019)
 
Automate your Amazon SageMaker Workflows (July 2019)
Automate your Amazon SageMaker Workflows (July 2019)Automate your Amazon SageMaker Workflows (July 2019)
Automate your Amazon SageMaker Workflows (July 2019)
 
Build, train and deploy ML models with Amazon SageMaker (May 2019)
Build, train and deploy ML models with Amazon SageMaker (May 2019)Build, train and deploy ML models with Amazon SageMaker (May 2019)
Build, train and deploy ML models with Amazon SageMaker (May 2019)
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

Deep Learning for Developers (October 2017)

  • 1. ©2017, Amazon Web Services, Inc. or its affiliates. All rights reserved Deep Learning for Developers Julien Simon <@julsimon> Principal Evangelist, AI/ML, EMEA
  • 2. Amazon AI for every developer
  • 3. The Nvidia V100 GPU is now available on AWS Launched October 25th https://aws.amazon.com/blogs/aws/new-amazon-ec2-instances-with-up-to-8-nvidia-tesla-v100-gpus-p3/ https://devblogs.nvidia.com/parallelforall/inside-volta/ MNIST on 1 GPU: 2x speedup vs p2
  • 4. Apache MXNet: Open Source library for Deep Learning Programmable Portable High Performance Near linear scaling across hundreds of GPUs Highly efficient models for mobile and IoT Simple syntax, multiple languages Most Open Best On AWS Optimized for Deep Learning on AWS Accepted into the Apache Incubator https://mxnet.io
  • 5. https://www.oreilly.com/ideas/self-driving-trucks-enter-the-fast-lane-using-deep-learning Last June, tuSimple drove an autonomous truck for 200 miles from Yuma, AZ to San Diego, CA
  • 6. Input Output 1 1 1 1 0 1 0 0 0 3 mx.sym.Convolution(data, kernel=(5,5), num_filter=20) mx.sym.Pooling(data, pool_type="max", kernel=(2,2), stride=(2,2) lstm.lstm_unroll(num_lstm_layer, seq_len, len, num_hidden, num_embed) 4 2 2 0 4=Max 1 3 ... 4 0.2 -0.1 ... 0.7 mx.sym.FullyConnected(data, num_hidden=128) 2 mx.symbol.Embedding(data, input_dim, output_dim = k) 0.2 -0.1 ... 0.7 Queen 4 2 2 0 2=Avg Input Weights cos(w, queen) = cos(w, king) - cos(w, man) + cos(w, woman) mx.sym.Activation(data, act_type="xxxx") "relu" "tanh" "sigmoid" "softrelu" Neural Art Face Search Image Segmentation Image Caption “People Riding Bikes” Bicycle, People, Road, Sport Image Labels Image Video Speech Text “People Riding Bikes” Machine Translation “Οι άνθρωποι ιππασίας ποδήλατα” Events mx.model.FeedForward model.fit mx.sym.SoftmaxOutput
  • 7. CPU or GPU: your choice mod = mx.mod.Module(lenet) mod = mx.mod.Module(lenet, context=mx.gpu(0)) mod = mx.mod.Module(lenet, context=(mx.gpu(7), mx.gpu(8), mx.gpu(9)))
  • 8. Ideal Inception v3 Resnet Alexnet 88% Efficiency 0 64 128 192 256 1 2 4 8 16 32 64 128 256 Multi-GPU Scaling With MXNet
  • 9. AWS Deep Learning AMI • Deep Learning Frameworks – Popular Deep Learning Frameworks (MXNet, Caffe, Tensorflow, Theano, Torch, etc.) all prebuilt and pre-installed • GPU components – Nvidia drivers, cuDNN, CUDA 8 & 9 • AWS Integration – Packages and configurations that provide tight integration with Amazon Web Services • Amazon Linux & Ubuntu https://aws.amazon.com/blogs/ai/announcing-new-aws-deep-learning-ami-for-amazon-ec2-p3-instances/
  • 10. Apache MXNet demos 1. Image classification: using pre-trained models Imagenet, multiple CNNs, MXNet 2. Image classification: fine-tuning a pre-trained model CIFAR-10, ResNet-50, Keras + MXNet 3. Image classification: learning from scratch MNIST, MLP & LeNet, MXNet 4. Machine Translation: translating German to English News, LSTM, Sockeye + MXNet
  • 11. Demo #1 – Image classification: using a pre-trained model *** VGG16 [(0.46811387, 'n04296562 stage'), (0.24333163, 'n03272010 electric guitar'), (0.045918692, 'n02231487 walking stick, walkingstick, stick insect'), (0.03316205, 'n04286575 spotlight, spot'), (0.021694135, 'n03691459 loudspeaker, speaker, speaker unit, loudspeaker system, speaker system')] *** ResNet-152 [(0.8726753, 'n04296562 stage'), (0.046159592, 'n03272010 electric guitar'), (0.041658506, 'n03759954 microphone, mike'), (0.018624334, 'n04286575 spotlight, spot'), (0.0058045341, 'n02676566 acoustic guitar')] *** Inception v3 [(0.44991142, 'n04296562 stage'), (0.43065304, 'n03272010 electric guitar'), (0.067580454, 'n04456115 torch'), (0.012423956, 'n02676566 acoustic guitar'), (0.0093934005, 'n03250847 drumstick')] https://medium.com/@julsimon/an-introduction-to-the-mxnet-api-part-5-9e78534096db
  • 12. Demo #2 – Image classification: fine-tuning a model • CIFAR-10 data set – 60,000 images in 10 classes – 32x32 color images • Initial training – Resnet-50 CNN – 200 epochs – 82.12% validation • Cars vs. horses – 88.8% validation accuracy https://medium.com/@julsimon/keras-shoot-out-part-3-fine-tuning-7d1548c51a41
  • 13. Demo #2 – Image classification: fine-tuning a model • Freezing all layers but the last one • Fine-tuning on « cars vs. horses » for 10 epochs • 2 minutes on 1 GPU • 98.8% validation accuracy Epoch 10/10 10000/10000 [==============================] - 12s loss: 1.6989 - acc: 0.9994 - val_loss: 1.7490 - val_acc: 0.9880 2000/2000 [==============================] - 2s [1.7490020694732666, 0.98799999999999999]
  • 14. Demo #3 – Image classification: learning from scratch • MNIST data set • 70,000 hand-written digits • 28x28 grayscale images https://medium.com/@julsimon/training-mxnet-part-1-mnist-6f0dc4210c62
  • 15. Multi-Layer Perceptron vs. Handmade-Digits-From-Hell™ 784/128/64/10, Relu, AdaGrad, 100 epochs à 97.51% validation accuracy [[ 0.839 0.034 0.039 0.009 0. 0.008 0.066 0.002 0. 0.004]] [[ 0. 0.988 0.001 0.003 0.001 0.001 0.002 0.003 0.001 0.002]] [[ 0.006 0.01 0.95 0.029 0. 0.001 0.004 0. 0. 0.]] [[ 0. 0. 0. 1. 0. 0. 0. 0. 0. 0.]] [[ 0. 0.001 0.005 0.001 0.982 0.001 0. 0.007 0. 0.002]] [[ 0.001 0.001 0. 0.078 0. 0.911 0.01 0. 0. 0.]] [[ 0.003 0. 0.019 0. 0.005 0.004 0.863 0. 0.105 0.001]] [[ 0.001 0.008 0.098 0.033 0. 0. 0. 0.852 0.004 0.004]] [[ 0.001 0. 0.006 0. 0. 0.001 0.002 0. 0.991 0.]] [[ 0.002 0.158 0.007 0.117 0.082 0.001 0. 0.239 0.17 0.224]]
  • 16. LeNet CNN vs. Handmade-Digits-From-Hell™ ReLu instead of tanh, 10 epochs, AdaGrad à 99.20% validation accuracy [[ 1. 0. 0. 0. 0. 0. 0. 0. 0. 0.]] [[ 0. 1. 0. 0. 0. 0. 0. 0. 0. 0.]] [[ 0. 0. 1. 0. 0. 0. 0. 0. 0. 0.]] [[ 0. 0. 0. 1. 0. 0. 0. 0. 0. 0.]] [[ 0. 0. 0.001 0. 0.998 0. 0. 0.001 0. 0.]] [[ 0. 0. 0. 0. 0. 1. 0. 0. 0. 0.]] [[ 0. 0. 0. 0. 0. 0. 1. 0. 0. 0.]] [[ 0. 0. 0. 0.001 0. 0. 0. 0.999 0. 0.]] [[ 0. 0. 0.006 0. 0. 0. 0. 0. 0.994 0.]] [[ 0. 0. 0. 0.001 0.001 0. 0. 0.001 0.001 0.996]]
  • 17. Demo #4 – Machine Translation: German to English • AWS Open Source project https://github.com/awslabs/sockeye • Sequence-to-sequence models with Apache MXNet • 5.8M sentences (news headlines), 5 hours of training on 8 GPUs (p2) ./translate.sh "Chopin zählt zu den bedeutendsten Persönlichkeiten der Musikgeschichte Polens .” Chopin is one of the most important personalities of Poland’s history ./translate.sh "Hotelbetreiber müssen künftig nur den Rundfunkbeitrag bezahlen, wenn ihre Zimmer auch eine Empfangsmöglichkeit bieten .” in the future , hotel operators must pay only the broadcasting fee if their rooms also offer a reception facility . https://aws.amazon.com/blogs/ai/train-neural-machine-translation-models-with-sockeye/
  • 18. Speeding up inference on CPU • Intel MKL https://software.intel.com/en-us/mkl • NNPACK https://github.com/Maratyszcza/NNPACK https://medium.com/@julsimon/speeding-up-apache-mxnet-with-the-nnpack-library-7427f367490f https://medium.com/@julsimon/speeding-up-apache-mxnet-with-the-nnpack-library-raspberry-pi-edition-e444b446a180
  • 19. Shrinking models • Complex neural networks are too large for resource-constrained environments • MXNet supports Mixed Precision Training • Use float16 instead of float32 • Almost 2x reduction in memory consumption, no loss of accuracy • https://devblogs.nvidia.com/parallelforall/mixed-precision-training-deep-neural-networks/ • http://docs.nvidia.com/deeplearning/sdk/mixed-precision-training/index.html#mxnet • BMXNet: Binary Neural Network Implementation • Use binary values • 20x to 30x reduction in model size, with limited loss • https://github.com/hpi-xnor/BMXNet
  • 20. Gluon: Deep Learning gets even easier https://github.com/gluon-api/ • Announced October 11th • Available now in MXNet, soon in Microsoft Cognitive Toolkit • Developer-friendly high-level API • No compromise on performance • Networks can be modified during training • Extensive model zoo https://aws.amazon.com/blogs/aws/introducing-gluon-a-new-library-for-machine-learning-from-aws-and-microsoft/ https://mxnet.incubator.apache.org/versions/master/api/python/gluon/model_zoo.html
  • 21. Anything you dream is fiction, and anything you accomplish is science, the whole history of mankind is nothing but science fiction. Ray Bradbury