© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Build, train and deploy Machine
Learning models at scale
Julien Simon
Global Evangelist, AI & Machine Learning
@julsimon
Put Machine Learning in the hands
of every developer and data scientist
Our mission
M L F R A M E W O R K S &
I N F R A S T R U C T U R E
The Amazon ML Stack: Broadest & Deepest Set of Capabilities
A I S E R V I C E S
R E K O G N I T I O N
I M A G E
P O L L Y T R A N S C R I B E T R A N S L A T E C O M P R E H E N D
C O M P R E H E N D
M E D I C A L
L E XR E K O G N I T I O N
V I D E O
Vision Speech Chatbots
A M A Z O N S A G E M A K E R
B U I L D T R A I N
F O R E C A S TT E X T R A C T P E R S O N A L I Z E
D E P L O Y
Pre-built algorithms & notebooks
Data labeling (G R O U N D T R U T H )
One-click model training & tuning
Optimization ( N E O )
One-click deployment & hosting
M L S E R V I C E S
F r a m e w o r k s I n t e r f a c e s I n f r a s t r u c t u r e
E C 2 P 3
& P 3 d n
E C 2 C 5 F P G A s G R E E N G R A S S E L A S T I C
I N F E R E N C E
Models without training data (REINFORCEMENT LEARNING)Algorithms & models ( A W S M A R K E T P L A C E )
Language Forecasting Recommendations
NEW NEWNEW
NEW
NEW
NEWNEW
NEW
NEW
Amazon SageMaker:
Build,Train, and Deploy ML Models at Scale
Collect and prepare
training data
Choose and optimize
your
ML algorithm
Train and
Tune ML Models
Set up and
manage
environments
for training
Deploy models
in production
Scale and manage
the production
environment
1
2
3
Machine learning cycle
Business
Problem
ML problem
framing
Data collection
Data integration
Data preparation
and cleaning
Data visualization
and analysis
Feature
engineering
Model training and
parameter tuning
Model evaluation
Monitoring and
debugging
Model deployment
Predictions
Are
business
goals
met?
YESNO
Dataaugmentation
Feature
augmentation
Re-training
Manage data on AWS
Business
Problem
ML problem
framing
Data collection
Data integration
Data preparation
and cleaning
Data visualization
and analysis
Feature
engineering
Model training and
parameter tuning
Model evaluation
Monitoring and
debugging
Model deployment
Predictions
Are
business
goals
met?
YESNO
Dataaugmentation
Feature
augmentation
Re-training
Build and train models using SageMaker
Business
Problem
ML problem
framing
Data collection
Data integration
Data preparation
and cleaning
Data visualization
and analysis
Feature
engineering
Model training and
parameter tuning
Model evaluation
Monitoring and
debugging
Model deployment
Predictions
Are
business
goals
met?
YESNO
Dataaugmentation
Feature
augmentation
Re-training
Deploy models using SageMaker
Business
Problem
ML problem
framing
Data collection
Data integration
Data preparation
and cleaning
Data visualization
and analysis
Feature
engineering
Model training and
parameter tuning
Model evaluation
Monitoring and
debugging
Model deployment
Predictions
Are
business
goals
met?
YESNO
Dataaugmentation
Feature
augmentation
Re-training
Amazon SageMaker
Fully managed
hosting with auto-
scaling
One-click
deployment
Pre-built
notebooks for
common
problems
Built-in, high-
performance
algorithms
and frameworks
One-click
training
Hyperparameter
optimization
DeployTrainBuild
Model compilation
Elastic inference
Inference pipelines
P3DN, C5N
TensorFlow on 256 GPUs
Resume HPO tuning job
New built-in algorithms
scikit-learn environment
Model marketplace
Search
Git integration
Elastic inference
Machine Learning Marketplace
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
TheAmazon SageMakerAPI
• Python SDK orchestrating all Amazon SageMaker activity
• High-level objects for algorithm selection, training, deploying,
automatic model tuning, etc.
• Spark SDK (Python & Scala)
• AWS CLI: ‘aws sagemaker’
• AWS SDK: boto3, etc.
Model Training (on EC2)
Model Hosting (on EC2)
Trainingdata
Modelartifacts
Training code Helper code
Helper codeInference code
GroundTruth
Client application
Inference code
Training code
Inference requestInference
response
Inference Endpoint
Training code
Factorization Machines
Linear Learner
PrincipalComponent Analysis
K-Means Clustering
XGBoost
And more
Built-inAlgorithms BringYour Own ContainerBringYour Own Script
Model options
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Built-in algorithms
orange: supervised, yellow: unsupervised
Linear Learner: regression, classification Image Classification: Deep Learning (ResNet)
Factorization Machines: regression, classification,
recommendation
Object Detection (SSD): Deep Learning
(VGG or ResNet)
K-Nearest Neighbors: non-parametric regression
and classification
NeuralTopic Model: topic modeling
XGBoost: regression, classification, ranking
https://github.com/dmlc/xgboost
Latent DirichletAllocation: topic modeling (mostly)
K-Means: clustering BlazingText:GPU-basedWord2Vec,
and text classification
Principal ComponentAnalysis: dimensionality
reduction
Sequence to Sequence: machine translation, speech
speech to text and more
RandomCut Forest: anomaly detection DeepAR: time-series forecasting (RNN)
Object2Vec: general-purpose embedding IP Insights: usage patterns for IP addresses
Semantic Segmentation: Deep Learning
Demo:
Image classification with Caltech-256
https://gitlab.com/juliensimon/dlnotebooks/sagemaker/
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Blazing Text
https://dl.acm.org/citation.cfm?id=3146354
Demo:
Text Classification with BlazingText
https://github.com/awslabs/amazon-sagemaker-
examples/tree/master/introduction_to_amazon_algorithms/blazingtext_text_classification_dbpedia
XGBoost
• Open Source project
• Popular tree-based algorithm
for regression, classification
and ranking
• Builds a collection of trees.
• Handles missing values
and sparse data
• Supports distributed training
• Can work with data sets larger
than RAM
https://github.com/dmlc/xgboost
https://xgboost.readthedocs.io/en/latest/
https://arxiv.org/abs/1603.02754
Demo: XGBoost
AWS re:Invent 2018 workshop
https://gitlab.com/juliensimon/ent321
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Demo:
Keras/TensorFlow CNN on CIFAR-10
https://github.com/awslabs/amazon-sagemaker-examples/blob/master/sagemaker-python-
sdk/tensorflow_keras_cifar10/tensorflow_keras_CIFAR10.ipynb
Demo:
Sentiment analysis with Apache MXNet
https://github.com/awslabs/amazon-sagemaker-examples/blob/master/sagemaker-python-
sdk/mxnet_sentiment_analysis_with_gluon.ipynb
Amazon SageMaker
Fully managed
hosting with auto-
scaling
One-click
deployment
Pre-built
notebooks for
common
problems
Built-in, high-
performance
algorithms
and frameworks
One-click
training
Hyperparameter
optimization
Build Train Deploy
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Getting started
http://aws.amazon.com/free
https://ml.aws
https://aws.amazon.com/sagemaker
https://github.com/aws/sagemaker-python-sdk
https://github.com/aws/sagemaker-spark
https://github.com/awslabs/amazon-sagemaker-examples
https://gitlab.com/juliensimon/ent321
https://medium.com/@julsimon
https://gitlab.com/juliensimon/dlnotebooks
Thank you!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Julien Simon
Global Evangelist,AI & Machine Learning
@julsimon
https://medium.com/@julsimon

Build, Train and Deploy Machine Learning Models at Scale (April 2019)

  • 1.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Build, train and deploy Machine Learning models at scale Julien Simon Global Evangelist, AI & Machine Learning @julsimon
  • 2.
    Put Machine Learningin the hands of every developer and data scientist Our mission
  • 3.
    M L FR A M E W O R K S & I N F R A S T R U C T U R E The Amazon ML Stack: Broadest & Deepest Set of Capabilities A I S E R V I C E S R E K O G N I T I O N I M A G E P O L L Y T R A N S C R I B E T R A N S L A T E C O M P R E H E N D C O M P R E H E N D M E D I C A L L E XR E K O G N I T I O N V I D E O Vision Speech Chatbots A M A Z O N S A G E M A K E R B U I L D T R A I N F O R E C A S TT E X T R A C T P E R S O N A L I Z E D E P L O Y Pre-built algorithms & notebooks Data labeling (G R O U N D T R U T H ) One-click model training & tuning Optimization ( N E O ) One-click deployment & hosting M L S E R V I C E S F r a m e w o r k s I n t e r f a c e s I n f r a s t r u c t u r e E C 2 P 3 & P 3 d n E C 2 C 5 F P G A s G R E E N G R A S S E L A S T I C I N F E R E N C E Models without training data (REINFORCEMENT LEARNING)Algorithms & models ( A W S M A R K E T P L A C E ) Language Forecasting Recommendations NEW NEWNEW NEW NEW NEWNEW NEW NEW
  • 4.
    Amazon SageMaker: Build,Train, andDeploy ML Models at Scale Collect and prepare training data Choose and optimize your ML algorithm Train and Tune ML Models Set up and manage environments for training Deploy models in production Scale and manage the production environment 1 2 3
  • 5.
    Machine learning cycle Business Problem MLproblem framing Data collection Data integration Data preparation and cleaning Data visualization and analysis Feature engineering Model training and parameter tuning Model evaluation Monitoring and debugging Model deployment Predictions Are business goals met? YESNO Dataaugmentation Feature augmentation Re-training
  • 6.
    Manage data onAWS Business Problem ML problem framing Data collection Data integration Data preparation and cleaning Data visualization and analysis Feature engineering Model training and parameter tuning Model evaluation Monitoring and debugging Model deployment Predictions Are business goals met? YESNO Dataaugmentation Feature augmentation Re-training
  • 7.
    Build and trainmodels using SageMaker Business Problem ML problem framing Data collection Data integration Data preparation and cleaning Data visualization and analysis Feature engineering Model training and parameter tuning Model evaluation Monitoring and debugging Model deployment Predictions Are business goals met? YESNO Dataaugmentation Feature augmentation Re-training
  • 8.
    Deploy models usingSageMaker Business Problem ML problem framing Data collection Data integration Data preparation and cleaning Data visualization and analysis Feature engineering Model training and parameter tuning Model evaluation Monitoring and debugging Model deployment Predictions Are business goals met? YESNO Dataaugmentation Feature augmentation Re-training
  • 9.
    Amazon SageMaker Fully managed hostingwith auto- scaling One-click deployment Pre-built notebooks for common problems Built-in, high- performance algorithms and frameworks One-click training Hyperparameter optimization DeployTrainBuild Model compilation Elastic inference Inference pipelines P3DN, C5N TensorFlow on 256 GPUs Resume HPO tuning job New built-in algorithms scikit-learn environment Model marketplace Search Git integration Elastic inference
  • 10.
  • 11.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 12.
    TheAmazon SageMakerAPI • PythonSDK orchestrating all Amazon SageMaker activity • High-level objects for algorithm selection, training, deploying, automatic model tuning, etc. • Spark SDK (Python & Scala) • AWS CLI: ‘aws sagemaker’ • AWS SDK: boto3, etc.
  • 13.
    Model Training (onEC2) Model Hosting (on EC2) Trainingdata Modelartifacts Training code Helper code Helper codeInference code GroundTruth Client application Inference code Training code Inference requestInference response Inference Endpoint
  • 14.
    Training code Factorization Machines LinearLearner PrincipalComponent Analysis K-Means Clustering XGBoost And more Built-inAlgorithms BringYour Own ContainerBringYour Own Script Model options
  • 15.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 16.
    Built-in algorithms orange: supervised,yellow: unsupervised Linear Learner: regression, classification Image Classification: Deep Learning (ResNet) Factorization Machines: regression, classification, recommendation Object Detection (SSD): Deep Learning (VGG or ResNet) K-Nearest Neighbors: non-parametric regression and classification NeuralTopic Model: topic modeling XGBoost: regression, classification, ranking https://github.com/dmlc/xgboost Latent DirichletAllocation: topic modeling (mostly) K-Means: clustering BlazingText:GPU-basedWord2Vec, and text classification Principal ComponentAnalysis: dimensionality reduction Sequence to Sequence: machine translation, speech speech to text and more RandomCut Forest: anomaly detection DeepAR: time-series forecasting (RNN) Object2Vec: general-purpose embedding IP Insights: usage patterns for IP addresses Semantic Segmentation: Deep Learning
  • 17.
    Demo: Image classification withCaltech-256 https://gitlab.com/juliensimon/dlnotebooks/sagemaker/
  • 18.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Blazing Text https://dl.acm.org/citation.cfm?id=3146354
  • 19.
    Demo: Text Classification withBlazingText https://github.com/awslabs/amazon-sagemaker- examples/tree/master/introduction_to_amazon_algorithms/blazingtext_text_classification_dbpedia
  • 20.
    XGBoost • Open Sourceproject • Popular tree-based algorithm for regression, classification and ranking • Builds a collection of trees. • Handles missing values and sparse data • Supports distributed training • Can work with data sets larger than RAM https://github.com/dmlc/xgboost https://xgboost.readthedocs.io/en/latest/ https://arxiv.org/abs/1603.02754
  • 21.
    Demo: XGBoost AWS re:Invent2018 workshop https://gitlab.com/juliensimon/ent321
  • 22.
    © 2019, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 23.
    Demo: Keras/TensorFlow CNN onCIFAR-10 https://github.com/awslabs/amazon-sagemaker-examples/blob/master/sagemaker-python- sdk/tensorflow_keras_cifar10/tensorflow_keras_CIFAR10.ipynb
  • 24.
    Demo: Sentiment analysis withApache MXNet https://github.com/awslabs/amazon-sagemaker-examples/blob/master/sagemaker-python- sdk/mxnet_sentiment_analysis_with_gluon.ipynb
  • 25.
    Amazon SageMaker Fully managed hostingwith auto- scaling One-click deployment Pre-built notebooks for common problems Built-in, high- performance algorithms and frameworks One-click training Hyperparameter optimization Build Train Deploy
  • 26.
    © 2018, AmazonWeb Services, Inc. or Its Affiliates. All rights reserved. Getting started http://aws.amazon.com/free https://ml.aws https://aws.amazon.com/sagemaker https://github.com/aws/sagemaker-python-sdk https://github.com/aws/sagemaker-spark https://github.com/awslabs/amazon-sagemaker-examples https://gitlab.com/juliensimon/ent321 https://medium.com/@julsimon https://gitlab.com/juliensimon/dlnotebooks
  • 27.
    Thank you! © 2019,Amazon Web Services, Inc. or its affiliates. All rights reserved. Julien Simon Global Evangelist,AI & Machine Learning @julsimon https://medium.com/@julsimon

Editor's Notes

  • #2 This talk is for builders I want to build a new app or website and I want it to work on every platform I want easily leverage AWS from my existing web or mobile apps and I don’t want to rewrite everything I want to learn about cool new development tools like React, GraphQL, CLIs, and serverless technologies I want to focus less on ops and configuration and more on my product If you recognize yourself in one of the previous sentences, you’re in the right room. TODO for the presenter : adjust the banner to the conference you will speak to.
  • #10 Once your model is trained and tuned, SageMaker makes it easy to deploy in production so you can start generating predictions on new data (a process called inference). Amazon SageMaker deploys your model on an auto-scaling cluster of Amazon EC2 instances that are spread across multiple availability zones to deliver both high performance and high availability. It also includes built-in A/B testing capabilities to help you test your model and experiment with different versions to achieve the best results.   For maximum versatility, we designed Amazon SageMaker in three modules – Build, Train, and Deploy – that can be used together or independently as part of any existing ML workflow you might already have in place.
  • #17 Seq2Seq: used by Amazon Translate and AWS Sockeye LDA: used by Amazon Comprehend
  • #21 Source: XGBoost research paper https://arxiv.org/abs/1603.02754
  • #26 Once your model is trained and tuned, SageMaker makes it easy to deploy in production so you can start generating predictions on new data (a process called inference). Amazon SageMaker deploys your model on an auto-scaling cluster of Amazon EC2 instances that are spread across multiple availability zones to deliver both high performance and high availability. It also includes built-in A/B testing capabilities to help you test your model and experiment with different versions to achieve the best results.   For maximum versatility, we designed Amazon SageMaker in three modules – Build, Train, and Deploy – that can be used together or independently as part of any existing ML workflow you might already have in place.
  • #28 TODO for the presenter : adjust the banner to the conference you will speak to.