More Related Content
Similar to Train & Deploy ML Models with Amazon Sagemaker: Collision 2018 (20)
More from Amazon Web Services (20)
Train & Deploy ML Models with Amazon Sagemaker: Collision 2018
- 1. Train and Deploy ML
Models with Amazon
Sagemaker
Julien Simon
Principal Evangelist, Artificial Intelligence & Machine Learning
@julsimon
April 2018
- 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Platform
Services
AWS ML Stack
Deploy machine learning models with high-performance machine learning
algorithms, broad framework support, and one-click training, tuning, and
inference.
- 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Visualization &
Analysis
Business Problem –
ML problem framing Data Collection
Data Integration
Data Preparation &
Cleaning
Feature Engineering
Model Training &
Parameter Tuning
Model Evaluation
Are Business
Goals met?
Model Deployment
Monitoring &
Debugging
YesNo
DataAugmentation
Feature
Augmentation
The Machine Learning Process
Re-training
Predictions
- 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Visualization &
Analysis
Business Problem –
ML problem framing Data Collection
Data Integration
Data Preparation &
Cleaning
Feature Engineering
Model Training &
Parameter Tuning
Model Evaluation
Are Business
Goals met?
Model Deployment
Monitoring &
Debugging
YesNo
DataAugmentation
Feature
Augmentation
Problem discovery
Re-training
• Help formulate the right
questions
• Domain Knowledge
Predictions
- 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Visualization &
Analysis
Business Problem –
ML problem framing Data Collection
Data Integration
Data Preparation &
Cleaning
Feature Engineering
Model Training &
Parameter Tuning
Model Evaluation
Are Business
Goals met?
Model Deployment
Monitoring &
Debugging
YesNo
DataAugmentation
Feature
Augmentation
Retraining
• Need a data platform?
• Amazon S3
• AWS Glue
• Amazon Athena
• Amazon EMR
• Amazon Redshift
Spectrum
Integration
Predictions
- 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Visualization &
Analysis
Business Problem –
ML problem framing Data Collection
Data Integration
Data Preparation &
Cleaning
Feature Engineering
Model Training &
Parameter Tuning
Model Evaluation
Are Business
Goals met?
Model Deployment
Monitoring &
Debugging
YesNo
DataAugmentation
Feature
Augmentation
Retraining
Model Training
Predictions
• Setup and manage
Notebook Environments
• Setup and manage
Training Clusters
• Write Data Connectors
• Scale ML algorithms to
large datasets
• Distribute ML training
algorithm to multiple
machines
• Secure Model artifacts
- 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Visualization &
Analysis
Business Problem –
ML problem framing Data Collection
Data Integration
Data Preparation &
Cleaning
Feature Engineering
Model Training &
Parameter Tuning
Model Evaluation
Are Business
Goals met?
Model Deployment
Monitoring &
Debugging
YesNo
DataAugmentation
Feature
Augmentation
Retraining
Model Deployment
Predictions
• Setup and manage Model
Inference Clusters
• Manage and Scale Model
Inference APIs
• Monitor and Debug Model
Predictions
• Models versioning and
performance tracking
• Automate New Model
version promotion to
production (A/B testing)
- 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
End-to-End
Machine Learning
Platform
Zero setup Flexible Model
Training
Pay by the second
$
Amazon SageMaker
Build, train, and deploy machine learning models at scale
- 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Highly-optimized
machine learning
algorithms
BuildPre-built
notebook
instances
Amazon SageMaker
- 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Highly-optimized
machine learning
algorithms
One-click training
for ML, DL, and
custom algorithms
BuildPre-built
notebook
instances
Easier training with
hyperparameter
optimization
Train
Amazon SageMaker
- 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
One-click training
for ML, DL, and
custom algorithms
Easier training with
hyperparameter
optimization
Highly-optimized
machine learning
algorithms
Deployment
without
engineering effort
Fully-managed
hosting at scale
BuildPre-built
notebook
instances
Deploy
Train
Amazon SageMaker
- 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ECR
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
Amazon SageMaker
- 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Open Source Containers for TF and MXNet
https://github.com/aws/sagemaker-tensorflow-containers
https://github.com/aws/sagemaker-mxnet-containers
• Customize them
• Run them locally for development and testing
• Run them on SageMaker for training and prediction at scale
- 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Bring your own container
https://github.com/aws/sagemaker-container-support
• Integration with SageMaker Python SDK Estimators, including:
• Downloading user-provided Python code
• Deserializing hyperparameters (preserving their Python types)
• bin/entry.py, the Docker entrypoint required by SageMaker
• Reading in the metadata files provided to the container during training
• nginx + Gunicorn HTTP server for serving inference requests
https://github.com/awslabs/amazon-sagemaker-examples/tree/master/advanced_functionality/scikit_bring_your_own
https://github.com/awslabs/amazon-sagemaker-examples/tree/master/advanced_functionality/r_bring_your_own
- 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
End-to-End
Machine Learning
Platform
Zero setup Flexible Model
Training
Pay by the second
$
Amazon SageMaker
Build, train, and deploy machine learning models at scale
- 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Example #1: binary classifier with Linear Learner built-in algo https://github.com/awslabs/amazon-sagemaker-
examples/tree/master/introduction_to_amazon_algorithms/linear_learner_mnist
Example #2: multi-class classifier with XGBoost built-in algo (low-level API) https://github.com/awslabs/amazon-
sagemaker-examples/tree/master/introduction_to_amazon_algorithms/xgboost_mnist
Example #3: bring your own code (TensorFlow or MXNet, we should let the participants choose)
• https://github.com/awslabs/amazon-sagemaker-examples/tree/master/sagemaker-python-
sdk/tensorflow_distributed_mnist
• https://github.com/awslabs/amazon-sagemaker-examples/tree/master/sagemaker-python-
sdk/mxnet_gluon_sentiment
Example #4: bring your own model (TensorFlow) and deploy it on SageMaker: https://github.com/awslabs/amazon-
sagemaker-examples/tree/master/advanced_functionality/tensorflow_iris_byom
Example #5 (optional): bring your own container https://github.com/awslabs/amazon-sagemaker-
examples/blob/master/advanced_functionality/scikit_bring_your_own/scikit_bring_your_own.ipynb
- 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Resources
https://aws.amazon.com/machine-learning
https://aws.amazon.com/blogs/ai
https://aws.amazon.com/sagemaker
https://github.com/awslabs/amazon-sagemaker-examples
https://github.com/aws/sagemaker-python-sdk
An overview of Amazon SageMaker
https://www.youtube.com/watch?v=ym7NEYEx9x4
https://medium.com/@julsimon