SlideShare una empresa de Scribd logo
1 de 62
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Randall Hunt – Some Guy From Los Angeles
@WhereML a Serverless AI Powered Location Guessing
Twitter Bot
Built with Amazon SageMaker and AWS Lambda
Based on LocationNet work by Jaeyoung Choi and Kevin Li
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
About Me
• Technical Evangelist at AWS
• I build some demos: https://github.com/ranman
• I write some blogs: https://aws.amazon.com/blogs/aws/author/randhunt/
• Formerly of SpaceX, NASA, MongoDB
• I like Python
• I dislike javascript
• I look ridiculous in my badge photo
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Example
Try it! Tweet to
@WhereML with a picture.
Hold your cell phone
camera to the screen
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Architecture
AWS Lambda FunctionAmazon API
Gateway
Amazon SageMaker
Model Artifacts
Inference
Endpoint
Inference code
Amazon ECR
Inference code
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Solving Some Of The Hardest Problems In Computer Science
Learning Language Perception Problem
Solving
Reasoning
The (60 year) rise of Artificial Intelligence
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Put machine learning in the hands of every developer
and data scientist
ML @ AWS: Our mission
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Customer Running ML on AWS Today
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Reviewing The ML Process
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
© 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
– Predictions
YesNo
DataAugmentation
Feature
Augmentation
The Machine Learning Process
Re-training
© 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
– Predictions
YesNo
DataAugmentation
Feature
Augmentation
Discovery: The Analysts
Re-training
• Help formulate the right
questions
• Domain Knowledge
© 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
– Predictions
YesNo
DataAugmentation
Feature
Augmentation
Integration: The Data Architecture
Retraining
• Build the data platform:
• Amazon S3
• AWS Glue
• Amazon Athena
• Amazon EMR
• Amazon Redshift
Spectrum
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Visualization &
Analysis
Feature Engineering
Model Training &
Parameter Tuning
Model Evaluation
• 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
Why We built Amazon SageMaker: The Model Training Undifferentiated Heavy Lifting
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Business Problem –
Model Deployment
Monitoring &
Debugging
– 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)
Why We built Amazon SageMaker: The Model Deployment Undifferentiated Heavy Lifting
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
A fully managed service that enables data scientists and
developers to quickly and easily build machine-learning
based models into production smart applications.
Amazon SageMaker
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon SageMaker
1 2 3 4
I I I I
Notebook Instances Algorithms ML Training Service ML Hosting Service
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
1
I
Notebook Instances
Zero Setup For Exploratory Data Analysis
Authoring &
Notebooks
ETL Access to AWS
Database services
Access to S3 Data
Lake
• Recommendations/Personalization
• Fraud Detection
• Forecasting
• Image Classification
• Churn Prediction
• Marketing Email/Campaign Targeting
• Log processing and anomaly detection
• Speech to Text
• More…
“Just add data”
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Streaming datasets,
for cheaper training
Train faster, in a
single pass
Greater reliability on
extremely large
datasets
Choice of several ML
algorithms
Amazon SageMaker: 10x better algorithms
2
I
Algorithms
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Cost vs. Time
$$$$
$$$
$$
$
Minutes Hours Days Weeks Months
Single
Machine
Distributed, with
Strong Machines
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Infinitely Scalable ML Algorithms
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
2
I
Algorithms
Training code
• Matrix Factorization
• Regression
• Principal Component Analysis
• K-Means Clustering
• Gradient Boosted Trees
• And More!
Amazon provided Algorithms
Bring Your Own Script (IM builds the Container)
IM Estimators in
Apache Spark Bring Your Own Algorithm (You build the Container)
Amazon SageMaker: 10x better algorithms
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Managed Distributed Training with Flexibility
Training code
• Matrix Factorization
• Regression
• Principal Component Analysis
• K-Means Clustering
• Gradient Boosted Trees
• And More!
Amazon provided Algorithms
Bring Your Own Script (IM builds the Container)
Bring Your Own Algorithm (You build the Container)
3
I
ML Training Service
Fetch Training data
Save Model Artifacts
Fully
managed –
Secured–
Amazon ECR
Save Inference Image
IM Estimators in
Apache Spark
CPU GPU HPO
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
4
I
ML Hosting Service
Amazon ECR
Amazon SageMaker
Easy Model Deployment to Amazon SageMaker
Versions of the same
inference code saved in
inference containers.
Prod is the primary
one, 50% of the traffic
must be served there!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
4
I
ML Hosting Service
Amazon ECR
Model Artifacts
Inference Image
Versions of the same
inference code saved in
inference containers.
Prod is the primary
one, 50% of the traffic
must be served there!
Create a Model
ModelName: prod
Amazon SageMaker
Easy Model Deployment to Amazon SageMaker
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
4
I
ML Hosting Service
Amazon ECR
Model Artifacts
Inference Image
Model versions
Versions of the same
inference code saved in
inference containers.
Prod is the primary
one, 50% of the traffic
must be served there!
Create versions of a Model
Amazon SageMaker
Easy Model Deployment to Amazon SageMaker
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
4
I
ML Hosting Service
Amazon ECR
30 50
10 10
InstanceType: c3.4xlarge
InitialInstanceCount: 3
ModelName: prod
VariantName: primary
InitialVariantWeight: 50
ProductionVariant
Model Artifacts
Inference Image
Model versions
Versions of the same
inference code saved in
inference containers.
Prod is the primary
one, 50% of the traffic
must be served there!
Create weighted
ProductionVariants
Amazon SageMaker
Easy Model Deployment to Amazon SageMaker
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
4
I
ML Hosting Service
Amazon ECR
30 50
10 10
ProductionVariant
Model Artifacts
Inference Image
Model versions
Versions of the same
inference code saved in
inference containers.
Prod is the primary
one, 50% of the traffic
must be served there!
Create an
EndpointConfiguration
from one or many
ProductionVariant(s)EndpointConfiguration
Amazon SageMaker
Easy Model Deployment to Amazon SageMaker
InstanceType: c3.4xlarge
InitialInstanceCount: 3
ModelName: prod
VariantName: primary
InitialVariantWeight: 50
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
4
I
ML Hosting Service
Amazon ECR
30 50
10 10
ProductionVariant
Model Artifacts
Inference Image
Model versions
Versions of the same
inference code saved in
inference containers.
Prod is the primary
one, 50% of the traffic
must be served there! Create an Endpoint from
one EndpointConfiguration
EndpointConfiguration
Inference Endpoint
Amazon SageMaker
Easy Model Deployment to Amazon SageMaker
InstanceType: c3.4xlarge
InitialInstanceCount: 3
ModelName: prod
VariantName: primary
InitialVariantWeight: 50
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
4
I
ML Hosting Service
Amazon ECR
30 50
10 10
ProductionVariant
Model Artifacts
Inference Image
Model versions
Versions of the same
inference code saved in
inference containers.
Prod is the primary
one, 50% of the traffic
must be served there!
One-Click!
EndpointConfiguration
Inference Endpoint
Amazon Provided Algorithms
Amazon SageMaker
Easy Model Deployment to Amazon SageMaker
InstanceType: c3.4xlarge
InitialInstanceCount: 3
ModelName: prod
VariantName: primary
InitialVariantWeight: 50
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
4
I
ML Hosting Service
ü Auto-Scaling Inference
APIs
ü A/B Testing (more to
come)
ü Low Latency & High
Throughput
ü Bring Your Own Model
ü Python SDK
Amazon SageMaker
Easy Model Deployment to Amazon SageMaker
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Building the Model
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Credits
• This model, LocationNet, was built by Jaeyoung Choi of
the International Computer Science Institute and Kevin
Li of the University of California, Berkley
• Supported by the AWS Cloud Credits for Research
Program
• Based on work on PlaNet by Weyland et. all
Ref: arxiv.org/abs/1602.05314 : PlaNet—Photo
Geolocation with Convolutional Neural Networks
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
LocationNet Model Approach
• Model trained and built with Apache MXNet
• Trained with 33.9 million geo-tagged images from the
AWS Multimedia Commons Dataset for 12 epochs over
9 days using a single p2.16xlarge.
• Uses Google’s S2 Spherical Geometry library to
subdivide the earth into 15,527 of multi-scale
geographic cells which serve as classes for the data.
• Built on ResNet-101 architecture
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Model Architecture
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Example S2 Multi-scale partitioning
Ref: arxiv.org/abs/1602.05314 : PlaNet—Photo Geolocation with
Convolutional Neural Networks
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Pros / Cons of this approach
• Surprisingly precise in cities
with larger numbers of
partitions
• Fast inference (<100ms on
t2.large)
• Excellent performance for
unique objects / landmarks
• Small model <300 MB can
be deployed anywhere
• Surprisingly inaccurate in
locales with fewer
partitions.
• Poor performance for
common objects / terrain
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Infrastructure for WhereML
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Architecture
1. Twitter Webhook calls to API Gateway endpoint
2. API Gateway invokes Lambda function with payload
from twitter
3. Lambda function calls out to SageMaker Inference
Endpoint with URL of image
4. Inference endpoint downloads image and classifies it
with LocationNet
5. Lambda posts results back to Twitter
AWS Lambda FunctionAmazon API
Gateway
SageMaker
Inference
Endpoint
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Amazon API Gateway
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
AWS Lambda Function
• Proxy-Invocation from API Gateway sends entire request to the Lambda
• AWS Lambda Function:
1. Parses the incoming request
2. Verifies it is from Twitter and verifies message integrity
3. Parses the tweet
4. Sends the media URL in tweet to SageMaker endpoint
5. Uses twitter API to respond to original tweet
• Billed per GB/Second. 400,000 GB/S perpetual free-tier.
• Any scale of requests, but SageMaker endpoint limited to 10,000 TPS
• Python
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Lambda Function – Verify Request
1 def lambda_handler(events, context):
2 # deal with bad requests
3 if event.get('path') != WEBHOOK_PATH:
4 return {'statusCode': 404, 'body': ''}
5 # deal with subscription calls
6 if event.get('httpMethod') == 'GET':
7 crc = event.get('queryStringParameters', {}).get('crc_token')
8 if not crc: return {'statusCode': 401, 'body': 'bad crc'}
9 return {'statusCode': 200, 'body': sign_crc(crc)}
10 # deal with bad crc
11 if not verify_request(event, context):
12 return {'statusCode': 400, 'body': 'bad crc'}
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Lambda Function – Verify Request Utilities
1 def sign_crc(crc):
2 h = hmac.new(
3 bytes(CONSUMER_SECRET, 'ascii'), bytes(crc, 'ascii'),
4 digestmod=sha256)
5 return json.dumps({
6 "response_token": "sha256="+b64encode(h.digest()).decode()
7 })
8
9 def verify_request(event, context):
10 crc = event['headers']['X-Twitter-Webhooks-Signature']
11 h = hmac.new(
12 bytes(CONSUMER_SECRET, 'ascii'),
13 bytes(event['body'], 'utf-8'),
14 digestmod=sha256)
15 crc = b64decode(crc[7:]) # strip out the first 7 characters ("sha256=")
16 return hmac.compare_digest(h.digest(), crc)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Lambda Function – SageMaker and Twitter
1 def lambda_handler(events, context):
2 # we're good! load that event up
3 twitter_events = json.loads(event['body'])
4 for event in twitter_events.get('tweet_create_events', []):
5 if validate_record(event):
6 body = json.dumps({'url': media, 'max_predictions': MAX_PREDICTIONS})
7 results = json.loads(
8 sagemaker.invoke_endpoint(EndpointName=ENDPOINT_NAME, Body=body)
9 )['Body'].read()
10 status = build_tweet(results)
11 twitter_api.PostUpdate(
12 " ?n" + status[0],
13 media=status[1],
14 in_reply_to_status_id=event['id_str'],
15 auto_populate_reply_metadata=True
16 )
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
SageMaker Architecture
• Docker container stored in ECR
• Autoscaling Endpoint spins up
containers as needed and
automatically fetches model
artifacts from S3 and puts them in
/opt/models
• Flask app responds to /ping and
/inference
Amazon SageMaker
Model Artifacts
Inference
Endpoint
Inference code
Amazon ECR
Inference code
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
SageMaker Inference Code – Load Model
1 import mxnet as mx
2 import numpy as np
3 sym, arg_params, aux_params = mx.model.load_checkpoint(MODEL_NAME, 12)
4 mod = mx.mod.Module(symbol=sym, context=mx.cpu())
5 mod.bind([('data', (1, 3, 224, 224))], for_training=False)
6 mod.set_params(arg_params, aux_params, allow_missing=True)
7 Batch = namedtuple('Batch', ['data'])
8 grids = load_grids()
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
SageMaker Inference Code – Predict
1 def predict(img, max_predictions):
2 mod.forward(Batch(img), is_train=False)
3 prob = mod.get_outputs()[0].asnumpy()[0]
4 pred = np.argsort(prob)[::-1]
5 result = []
6 for i in range(max_predictions):
7 pred_loc = grids[int(pred[i])]
8 result.append((pred_loc, prob[]))
9 return result
10
11 def download_and_predict(url, max_predictions=3):
12 img = preprocess_image(download_image(url))
13 return predict(img, max_predictions)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
SageMaker Inference Code – Flask App
1 from flask import request, jsonify, Flask
2 import predict
3 app = Flask("WhereML")
4
5 @app.route("/ping")
6 def ping():
7 return "", 200
8
9 @app.route("/invocations", methods=["POST"])
10 def invoke():
11 data = request.get_json(force=True)
12 return jsonify(predict.download_and_predict(data['url']))
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
SageMaker Inference Code – Docker File
1 FROM mxnet/python:latest
2 WORKDIR /app
3 RUN pip install -U flask scikit-image numpy reverse_geocoder boto3
4 COPY *.py /app/
5 COPY grids.txt /app/
6 ENTRYPOINT ["python", "app.py"]
7 EXPOSE 8080
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Working with Twitter
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Twitter API
• Two ways to respond to mentions: User Streams API
(deprecated) and Account Activity API (beta)
• Account Activity Webhooks allow fully “serverless” approach
• UserStreams API requires running container/instance to poll
for updates
• UserStreams API is going away in June 2018… even though
the replacement for it is not GA…
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Registering Webhook
1 twitter = OAuth1Session(**keys)
2 base_url = "https://api.twitter.com/1.1/all/env-beta/"
3 params={'url': "https://mywebsite.com/twitter/whereml"}
4 webhook_id = twitter.post(base_url+"webhooks.json", params).json()['id']
5 # pass webhook ID in prod, not needed in beta
6 twitter.post(base_url+"subscriptions.json")
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
SageMaker
Notebooks
Training
Algorithm
SageMaker
Training
Amazon ECR
Code Commit
Code Pipeline
SageMaker
Hosting
dataset
AWS
Lambda
API
Gateway
SageMaker Example End-to-End Architecture
Build
Train
Deploy
static website hosted on S3
Inference requests
Amazon S3
Amazon
Cloudfront
Web assets on
Cloudfront
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Easy to get started!
Tons of tools
Machine Learning is FUN
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Built live on twitch.tv/aws
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
Thank you!
randhunt@amazon.com

Más contenido relacionado

La actualidad más candente

Introduction to Mobile Development with AWS
Introduction to Mobile Development with AWSIntroduction to Mobile Development with AWS
Introduction to Mobile Development with AWSAmazon Web Services
 
SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center
 SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center
SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact CenterAmazon Web Services
 
Invite Your Prospects With an Engaging Email Campaign
Invite Your Prospects With an Engaging Email CampaignInvite Your Prospects With an Engaging Email Campaign
Invite Your Prospects With an Engaging Email CampaignAmazon Web Services
 
Building and Deploying Your First Serverless Application
Building and Deploying Your First Serverless ApplicationBuilding and Deploying Your First Serverless Application
Building and Deploying Your First Serverless ApplicationAmazon Web Services
 
Introduction to Data Driven Apps with GraphQL
Introduction to Data Driven Apps with GraphQLIntroduction to Data Driven Apps with GraphQL
Introduction to Data Driven Apps with GraphQLAmazon Web Services
 
Build a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UIBuild a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UIAmazon Web Services
 
Getting Started with AWS for Developers: Collision 2018
Getting Started with AWS for Developers: Collision 2018Getting Started with AWS for Developers: Collision 2018
Getting Started with AWS for Developers: Collision 2018Amazon Web Services
 
Serverless Architectural Patterns: Collision 2018
Serverless Architectural Patterns: Collision 2018Serverless Architectural Patterns: Collision 2018
Serverless Architectural Patterns: Collision 2018Amazon Web Services
 
Programming Infrastructure with AWS CDK
Programming Infrastructure with AWS CDKProgramming Infrastructure with AWS CDK
Programming Infrastructure with AWS CDKDonnie Prakoso
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingAmazon Web Services
 
Introducing AWS Cloud9 - AWS Online Tech Talks
Introducing AWS Cloud9 - AWS Online Tech TalksIntroducing AWS Cloud9 - AWS Online Tech Talks
Introducing AWS Cloud9 - AWS Online Tech TalksAmazon Web Services
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep DiveAmazon Web Services
 
Authentication and Identity with Amazon Cognito & Analytics with Amazon Pinpoint
Authentication and Identity with Amazon Cognito & Analytics with Amazon PinpointAuthentication and Identity with Amazon Cognito & Analytics with Amazon Pinpoint
Authentication and Identity with Amazon Cognito & Analytics with Amazon PinpointAmazon Web Services
 
Build a Voice-Based Chatbot for Your Amazon Connect Contact Center
Build a Voice-Based Chatbot for Your Amazon Connect Contact CenterBuild a Voice-Based Chatbot for Your Amazon Connect Contact Center
Build a Voice-Based Chatbot for Your Amazon Connect Contact CenterAmazon Web Services
 
Build a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UIBuild a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UIAmazon Web Services
 

La actualidad más candente (20)

Introduction to Mobile Development with AWS
Introduction to Mobile Development with AWSIntroduction to Mobile Development with AWS
Introduction to Mobile Development with AWS
 
Serverless - State of the Union
Serverless - State of the UnionServerless - State of the Union
Serverless - State of the Union
 
SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center
 SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center
SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center
 
Invite Your Prospects With an Engaging Email Campaign
Invite Your Prospects With an Engaging Email CampaignInvite Your Prospects With an Engaging Email Campaign
Invite Your Prospects With an Engaging Email Campaign
 
Building and Deploying Your First Serverless Application
Building and Deploying Your First Serverless ApplicationBuilding and Deploying Your First Serverless Application
Building and Deploying Your First Serverless Application
 
Introduction to Data Driven Apps with GraphQL
Introduction to Data Driven Apps with GraphQLIntroduction to Data Driven Apps with GraphQL
Introduction to Data Driven Apps with GraphQL
 
Building Web Apps on AWS
Building Web Apps on AWSBuilding Web Apps on AWS
Building Web Apps on AWS
 
Build a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UIBuild a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UI
 
Containers - State of the Union
Containers - State of the UnionContainers - State of the Union
Containers - State of the Union
 
Getting Started with AWS for Developers: Collision 2018
Getting Started with AWS for Developers: Collision 2018Getting Started with AWS for Developers: Collision 2018
Getting Started with AWS for Developers: Collision 2018
 
Serverless Architectural Patterns: Collision 2018
Serverless Architectural Patterns: Collision 2018Serverless Architectural Patterns: Collision 2018
Serverless Architectural Patterns: Collision 2018
 
Programming Infrastructure with AWS CDK
Programming Infrastructure with AWS CDKProgramming Infrastructure with AWS CDK
Programming Infrastructure with AWS CDK
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless Computing
 
Introducing AWS Cloud9 - AWS Online Tech Talks
Introducing AWS Cloud9 - AWS Online Tech TalksIntroducing AWS Cloud9 - AWS Online Tech Talks
Introducing AWS Cloud9 - AWS Online Tech Talks
 
Introduction to AWS Amplify CLI
Introduction to AWS Amplify CLIIntroduction to AWS Amplify CLI
Introduction to AWS Amplify CLI
 
Module 6-Serverless-GraphQL-API
Module 6-Serverless-GraphQL-APIModule 6-Serverless-GraphQL-API
Module 6-Serverless-GraphQL-API
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 
Authentication and Identity with Amazon Cognito & Analytics with Amazon Pinpoint
Authentication and Identity with Amazon Cognito & Analytics with Amazon PinpointAuthentication and Identity with Amazon Cognito & Analytics with Amazon Pinpoint
Authentication and Identity with Amazon Cognito & Analytics with Amazon Pinpoint
 
Build a Voice-Based Chatbot for Your Amazon Connect Contact Center
Build a Voice-Based Chatbot for Your Amazon Connect Contact CenterBuild a Voice-Based Chatbot for Your Amazon Connect Contact Center
Build a Voice-Based Chatbot for Your Amazon Connect Contact Center
 
Build a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UIBuild a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UI
 

Similar a Building a Serverless AI Powered Twitter Bot: Collision 2018

WhereML a Serverless ML Powered Location Guessing Twitter Bot
WhereML a Serverless ML Powered Location Guessing Twitter BotWhereML a Serverless ML Powered Location Guessing Twitter Bot
WhereML a Serverless ML Powered Location Guessing Twitter BotRandall Hunt
 
NEW LAUNCH! Integrating Amazon SageMaker into your Enterprise - MCL345 - re:I...
NEW LAUNCH! Integrating Amazon SageMaker into your Enterprise - MCL345 - re:I...NEW LAUNCH! Integrating Amazon SageMaker into your Enterprise - MCL345 - re:I...
NEW LAUNCH! Integrating Amazon SageMaker into your Enterprise - MCL345 - re:I...Amazon Web Services
 
Mcl345 re invent_sagemaker_dmbanga
Mcl345 re invent_sagemaker_dmbangaMcl345 re invent_sagemaker_dmbanga
Mcl345 re invent_sagemaker_dmbangaDan Romuald Mbanga
 
Supercharge your Machine Learning Solutions with Amazon SageMaker
Supercharge your Machine Learning Solutions with Amazon SageMakerSupercharge your Machine Learning Solutions with Amazon SageMaker
Supercharge your Machine Learning Solutions with Amazon SageMakerAmazon Web Services
 
Supercharge Your Machine Learning Solutions with Amazon SageMaker
Supercharge Your Machine Learning Solutions with Amazon SageMakerSupercharge Your Machine Learning Solutions with Amazon SageMaker
Supercharge Your Machine Learning Solutions with Amazon SageMakerAmazon Web Services
 
Working with Amazon SageMaker Algorithms for Faster Model Training
Working with Amazon SageMaker Algorithms for Faster Model TrainingWorking with Amazon SageMaker Algorithms for Faster Model Training
Working with Amazon SageMaker Algorithms for Faster Model TrainingAmazon Web Services
 
End to End Model Development to Deployment using SageMaker
End to End Model Development to Deployment using SageMakerEnd to End Model Development to Deployment using SageMaker
End to End Model Development to Deployment using SageMakerAmazon Web Services
 
AWS Machine Learning Week SF: End to End Model Development Using SageMaker
AWS Machine Learning Week SF: End to End Model Development Using SageMakerAWS Machine Learning Week SF: End to End Model Development Using SageMaker
AWS Machine Learning Week SF: End to End Model Development Using SageMakerAmazon Web Services
 
Work with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS Summit
Work with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS SummitWork with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS Summit
Work with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS SummitAmazon Web Services
 
Amazon SageMaker workshop
Amazon SageMaker workshopAmazon SageMaker workshop
Amazon SageMaker workshopJulien SIMON
 
Train & Deploy ML Models with Amazon Sagemaker: Collision 2018
Train & Deploy ML Models with Amazon Sagemaker: Collision 2018Train & Deploy ML Models with Amazon Sagemaker: Collision 2018
Train & Deploy ML Models with Amazon Sagemaker: Collision 2018Amazon Web Services
 
Machine Learning: From Notebook to Production with Amazon Sagemaker (April 2018)
Machine Learning: From Notebook to Production with Amazon Sagemaker (April 2018)Machine Learning: From Notebook to Production with Amazon Sagemaker (April 2018)
Machine Learning: From Notebook to Production with Amazon Sagemaker (April 2018)Julien SIMON
 
Integrating Deep Learning Into Your Enterprise
Integrating Deep Learning Into Your EnterpriseIntegrating Deep Learning Into Your Enterprise
Integrating Deep Learning Into Your EnterpriseAmazon Web Services
 
Integrating Deep Learning In the Enterprise
Integrating Deep Learning In the EnterpriseIntegrating Deep Learning In the Enterprise
Integrating Deep Learning In the EnterpriseAmazon Web Services
 
Integrating Deep Learning into your Enterprise
Integrating Deep Learning into your EnterpriseIntegrating Deep Learning into your Enterprise
Integrating Deep Learning into your EnterpriseAmazon Web Services
 
Machine Learning: From Notebook to Production with Amazon Sagemaker
Machine Learning: From Notebook to Production with Amazon SagemakerMachine Learning: From Notebook to Production with Amazon Sagemaker
Machine Learning: From Notebook to Production with Amazon SagemakerAmazon Web Services
 
Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...
Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...
Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...Amazon Web Services
 
Integrating Amazon SageMaker into your Enterprise - AWS Online Tech Talks
Integrating Amazon SageMaker into your Enterprise - AWS Online Tech TalksIntegrating Amazon SageMaker into your Enterprise - AWS Online Tech Talks
Integrating Amazon SageMaker into your Enterprise - AWS Online Tech TalksAmazon Web Services
 
Predicting the Future with Amazon SageMaker - AWS Summit Sydney 2018
Predicting the Future with Amazon SageMaker - AWS Summit Sydney 2018Predicting the Future with Amazon SageMaker - AWS Summit Sydney 2018
Predicting the Future with Amazon SageMaker - AWS Summit Sydney 2018Amazon Web Services
 
Machine Learning - From Notebook to Production with Amazon Sagemaker
Machine Learning - From Notebook to Production with Amazon SagemakerMachine Learning - From Notebook to Production with Amazon Sagemaker
Machine Learning - From Notebook to Production with Amazon SagemakerAmazon Web Services
 

Similar a Building a Serverless AI Powered Twitter Bot: Collision 2018 (20)

WhereML a Serverless ML Powered Location Guessing Twitter Bot
WhereML a Serverless ML Powered Location Guessing Twitter BotWhereML a Serverless ML Powered Location Guessing Twitter Bot
WhereML a Serverless ML Powered Location Guessing Twitter Bot
 
NEW LAUNCH! Integrating Amazon SageMaker into your Enterprise - MCL345 - re:I...
NEW LAUNCH! Integrating Amazon SageMaker into your Enterprise - MCL345 - re:I...NEW LAUNCH! Integrating Amazon SageMaker into your Enterprise - MCL345 - re:I...
NEW LAUNCH! Integrating Amazon SageMaker into your Enterprise - MCL345 - re:I...
 
Mcl345 re invent_sagemaker_dmbanga
Mcl345 re invent_sagemaker_dmbangaMcl345 re invent_sagemaker_dmbanga
Mcl345 re invent_sagemaker_dmbanga
 
Supercharge your Machine Learning Solutions with Amazon SageMaker
Supercharge your Machine Learning Solutions with Amazon SageMakerSupercharge your Machine Learning Solutions with Amazon SageMaker
Supercharge your Machine Learning Solutions with Amazon SageMaker
 
Supercharge Your Machine Learning Solutions with Amazon SageMaker
Supercharge Your Machine Learning Solutions with Amazon SageMakerSupercharge Your Machine Learning Solutions with Amazon SageMaker
Supercharge Your Machine Learning Solutions with Amazon SageMaker
 
Working with Amazon SageMaker Algorithms for Faster Model Training
Working with Amazon SageMaker Algorithms for Faster Model TrainingWorking with Amazon SageMaker Algorithms for Faster Model Training
Working with Amazon SageMaker Algorithms for Faster Model Training
 
End to End Model Development to Deployment using SageMaker
End to End Model Development to Deployment using SageMakerEnd to End Model Development to Deployment using SageMaker
End to End Model Development to Deployment using SageMaker
 
AWS Machine Learning Week SF: End to End Model Development Using SageMaker
AWS Machine Learning Week SF: End to End Model Development Using SageMakerAWS Machine Learning Week SF: End to End Model Development Using SageMaker
AWS Machine Learning Week SF: End to End Model Development Using SageMaker
 
Work with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS Summit
Work with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS SummitWork with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS Summit
Work with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS Summit
 
Amazon SageMaker workshop
Amazon SageMaker workshopAmazon SageMaker workshop
Amazon SageMaker workshop
 
Train & Deploy ML Models with Amazon Sagemaker: Collision 2018
Train & Deploy ML Models with Amazon Sagemaker: Collision 2018Train & Deploy ML Models with Amazon Sagemaker: Collision 2018
Train & Deploy ML Models with Amazon Sagemaker: Collision 2018
 
Machine Learning: From Notebook to Production with Amazon Sagemaker (April 2018)
Machine Learning: From Notebook to Production with Amazon Sagemaker (April 2018)Machine Learning: From Notebook to Production with Amazon Sagemaker (April 2018)
Machine Learning: From Notebook to Production with Amazon Sagemaker (April 2018)
 
Integrating Deep Learning Into Your Enterprise
Integrating Deep Learning Into Your EnterpriseIntegrating Deep Learning Into Your Enterprise
Integrating Deep Learning Into Your Enterprise
 
Integrating Deep Learning In the Enterprise
Integrating Deep Learning In the EnterpriseIntegrating Deep Learning In the Enterprise
Integrating Deep Learning In the Enterprise
 
Integrating Deep Learning into your Enterprise
Integrating Deep Learning into your EnterpriseIntegrating Deep Learning into your Enterprise
Integrating Deep Learning into your Enterprise
 
Machine Learning: From Notebook to Production with Amazon Sagemaker
Machine Learning: From Notebook to Production with Amazon SagemakerMachine Learning: From Notebook to Production with Amazon Sagemaker
Machine Learning: From Notebook to Production with Amazon Sagemaker
 
Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...
Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...
Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...
 
Integrating Amazon SageMaker into your Enterprise - AWS Online Tech Talks
Integrating Amazon SageMaker into your Enterprise - AWS Online Tech TalksIntegrating Amazon SageMaker into your Enterprise - AWS Online Tech Talks
Integrating Amazon SageMaker into your Enterprise - AWS Online Tech Talks
 
Predicting the Future with Amazon SageMaker - AWS Summit Sydney 2018
Predicting the Future with Amazon SageMaker - AWS Summit Sydney 2018Predicting the Future with Amazon SageMaker - AWS Summit Sydney 2018
Predicting the Future with Amazon SageMaker - AWS Summit Sydney 2018
 
Machine Learning - From Notebook to Production with Amazon Sagemaker
Machine Learning - From Notebook to Production with Amazon SagemakerMachine Learning - From Notebook to Production with Amazon Sagemaker
Machine Learning - From Notebook to Production with Amazon Sagemaker
 

Más de Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Más de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Building a Serverless AI Powered Twitter Bot: Collision 2018

  • 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Randall Hunt – Some Guy From Los Angeles @WhereML a Serverless AI Powered Location Guessing Twitter Bot Built with Amazon SageMaker and AWS Lambda Based on LocationNet work by Jaeyoung Choi and Kevin Li
  • 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt About Me • Technical Evangelist at AWS • I build some demos: https://github.com/ranman • I write some blogs: https://aws.amazon.com/blogs/aws/author/randhunt/ • Formerly of SpaceX, NASA, MongoDB • I like Python • I dislike javascript • I look ridiculous in my badge photo
  • 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Example Try it! Tweet to @WhereML with a picture. Hold your cell phone camera to the screen
  • 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Architecture AWS Lambda FunctionAmazon API Gateway Amazon SageMaker Model Artifacts Inference Endpoint Inference code Amazon ECR Inference code
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Solving Some Of The Hardest Problems In Computer Science Learning Language Perception Problem Solving Reasoning
  • 6. The (60 year) rise of Artificial Intelligence
  • 7.
  • 8.
  • 9.
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Put machine learning in the hands of every developer and data scientist ML @ AWS: Our mission
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Customer Running ML on AWS Today
  • 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Reviewing The ML Process
  • 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
  • 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
  • 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
  • 16. © 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 – Predictions YesNo DataAugmentation Feature Augmentation The Machine Learning Process Re-training
  • 17. © 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 – Predictions YesNo DataAugmentation Feature Augmentation Discovery: The Analysts Re-training • Help formulate the right questions • Domain Knowledge
  • 18. © 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 – Predictions YesNo DataAugmentation Feature Augmentation Integration: The Data Architecture Retraining • Build the data platform: • Amazon S3 • AWS Glue • Amazon Athena • Amazon EMR • Amazon Redshift Spectrum
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Data Visualization & Analysis Feature Engineering Model Training & Parameter Tuning Model Evaluation • 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 Why We built Amazon SageMaker: The Model Training Undifferentiated Heavy Lifting
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Business Problem – Model Deployment Monitoring & Debugging – 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) Why We built Amazon SageMaker: The Model Deployment Undifferentiated Heavy Lifting
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. A fully managed service that enables data scientists and developers to quickly and easily build machine-learning based models into production smart applications. Amazon SageMaker
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon SageMaker 1 2 3 4 I I I I Notebook Instances Algorithms ML Training Service ML Hosting Service
  • 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 1 I Notebook Instances Zero Setup For Exploratory Data Analysis Authoring & Notebooks ETL Access to AWS Database services Access to S3 Data Lake • Recommendations/Personalization • Fraud Detection • Forecasting • Image Classification • Churn Prediction • Marketing Email/Campaign Targeting • Log processing and anomaly detection • Speech to Text • More… “Just add data”
  • 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Streaming datasets, for cheaper training Train faster, in a single pass Greater reliability on extremely large datasets Choice of several ML algorithms Amazon SageMaker: 10x better algorithms 2 I Algorithms
  • 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Cost vs. Time $$$$ $$$ $$ $ Minutes Hours Days Weeks Months Single Machine Distributed, with Strong Machines
  • 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Infinitely Scalable ML Algorithms
  • 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 2 I Algorithms Training code • Matrix Factorization • Regression • Principal Component Analysis • K-Means Clustering • Gradient Boosted Trees • And More! Amazon provided Algorithms Bring Your Own Script (IM builds the Container) IM Estimators in Apache Spark Bring Your Own Algorithm (You build the Container) Amazon SageMaker: 10x better algorithms
  • 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Managed Distributed Training with Flexibility Training code • Matrix Factorization • Regression • Principal Component Analysis • K-Means Clustering • Gradient Boosted Trees • And More! Amazon provided Algorithms Bring Your Own Script (IM builds the Container) Bring Your Own Algorithm (You build the Container) 3 I ML Training Service Fetch Training data Save Model Artifacts Fully managed – Secured– Amazon ECR Save Inference Image IM Estimators in Apache Spark CPU GPU HPO
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 4 I ML Hosting Service Amazon ECR Amazon SageMaker Easy Model Deployment to Amazon SageMaker Versions of the same inference code saved in inference containers. Prod is the primary one, 50% of the traffic must be served there!
  • 30. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 4 I ML Hosting Service Amazon ECR Model Artifacts Inference Image Versions of the same inference code saved in inference containers. Prod is the primary one, 50% of the traffic must be served there! Create a Model ModelName: prod Amazon SageMaker Easy Model Deployment to Amazon SageMaker
  • 31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 4 I ML Hosting Service Amazon ECR Model Artifacts Inference Image Model versions Versions of the same inference code saved in inference containers. Prod is the primary one, 50% of the traffic must be served there! Create versions of a Model Amazon SageMaker Easy Model Deployment to Amazon SageMaker
  • 32. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 4 I ML Hosting Service Amazon ECR 30 50 10 10 InstanceType: c3.4xlarge InitialInstanceCount: 3 ModelName: prod VariantName: primary InitialVariantWeight: 50 ProductionVariant Model Artifacts Inference Image Model versions Versions of the same inference code saved in inference containers. Prod is the primary one, 50% of the traffic must be served there! Create weighted ProductionVariants Amazon SageMaker Easy Model Deployment to Amazon SageMaker
  • 33. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 4 I ML Hosting Service Amazon ECR 30 50 10 10 ProductionVariant Model Artifacts Inference Image Model versions Versions of the same inference code saved in inference containers. Prod is the primary one, 50% of the traffic must be served there! Create an EndpointConfiguration from one or many ProductionVariant(s)EndpointConfiguration Amazon SageMaker Easy Model Deployment to Amazon SageMaker InstanceType: c3.4xlarge InitialInstanceCount: 3 ModelName: prod VariantName: primary InitialVariantWeight: 50
  • 34. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 4 I ML Hosting Service Amazon ECR 30 50 10 10 ProductionVariant Model Artifacts Inference Image Model versions Versions of the same inference code saved in inference containers. Prod is the primary one, 50% of the traffic must be served there! Create an Endpoint from one EndpointConfiguration EndpointConfiguration Inference Endpoint Amazon SageMaker Easy Model Deployment to Amazon SageMaker InstanceType: c3.4xlarge InitialInstanceCount: 3 ModelName: prod VariantName: primary InitialVariantWeight: 50
  • 35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 4 I ML Hosting Service Amazon ECR 30 50 10 10 ProductionVariant Model Artifacts Inference Image Model versions Versions of the same inference code saved in inference containers. Prod is the primary one, 50% of the traffic must be served there! One-Click! EndpointConfiguration Inference Endpoint Amazon Provided Algorithms Amazon SageMaker Easy Model Deployment to Amazon SageMaker InstanceType: c3.4xlarge InitialInstanceCount: 3 ModelName: prod VariantName: primary InitialVariantWeight: 50
  • 36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 4 I ML Hosting Service ü Auto-Scaling Inference APIs ü A/B Testing (more to come) ü Low Latency & High Throughput ü Bring Your Own Model ü Python SDK Amazon SageMaker Easy Model Deployment to Amazon SageMaker
  • 37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Building the Model
  • 38. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Credits • This model, LocationNet, was built by Jaeyoung Choi of the International Computer Science Institute and Kevin Li of the University of California, Berkley • Supported by the AWS Cloud Credits for Research Program • Based on work on PlaNet by Weyland et. all Ref: arxiv.org/abs/1602.05314 : PlaNet—Photo Geolocation with Convolutional Neural Networks
  • 39. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt LocationNet Model Approach • Model trained and built with Apache MXNet • Trained with 33.9 million geo-tagged images from the AWS Multimedia Commons Dataset for 12 epochs over 9 days using a single p2.16xlarge. • Uses Google’s S2 Spherical Geometry library to subdivide the earth into 15,527 of multi-scale geographic cells which serve as classes for the data. • Built on ResNet-101 architecture
  • 40. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Model Architecture
  • 41. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Example S2 Multi-scale partitioning Ref: arxiv.org/abs/1602.05314 : PlaNet—Photo Geolocation with Convolutional Neural Networks
  • 42. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt
  • 43. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Pros / Cons of this approach • Surprisingly precise in cities with larger numbers of partitions • Fast inference (<100ms on t2.large) • Excellent performance for unique objects / landmarks • Small model <300 MB can be deployed anywhere • Surprisingly inaccurate in locales with fewer partitions. • Poor performance for common objects / terrain
  • 44. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Infrastructure for WhereML
  • 45. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Architecture 1. Twitter Webhook calls to API Gateway endpoint 2. API Gateway invokes Lambda function with payload from twitter 3. Lambda function calls out to SageMaker Inference Endpoint with URL of image 4. Inference endpoint downloads image and classifies it with LocationNet 5. Lambda posts results back to Twitter AWS Lambda FunctionAmazon API Gateway SageMaker Inference Endpoint
  • 46. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Amazon API Gateway
  • 47. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt AWS Lambda Function • Proxy-Invocation from API Gateway sends entire request to the Lambda • AWS Lambda Function: 1. Parses the incoming request 2. Verifies it is from Twitter and verifies message integrity 3. Parses the tweet 4. Sends the media URL in tweet to SageMaker endpoint 5. Uses twitter API to respond to original tweet • Billed per GB/Second. 400,000 GB/S perpetual free-tier. • Any scale of requests, but SageMaker endpoint limited to 10,000 TPS • Python
  • 48. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Lambda Function – Verify Request 1 def lambda_handler(events, context): 2 # deal with bad requests 3 if event.get('path') != WEBHOOK_PATH: 4 return {'statusCode': 404, 'body': ''} 5 # deal with subscription calls 6 if event.get('httpMethod') == 'GET': 7 crc = event.get('queryStringParameters', {}).get('crc_token') 8 if not crc: return {'statusCode': 401, 'body': 'bad crc'} 9 return {'statusCode': 200, 'body': sign_crc(crc)} 10 # deal with bad crc 11 if not verify_request(event, context): 12 return {'statusCode': 400, 'body': 'bad crc'}
  • 49. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Lambda Function – Verify Request Utilities 1 def sign_crc(crc): 2 h = hmac.new( 3 bytes(CONSUMER_SECRET, 'ascii'), bytes(crc, 'ascii'), 4 digestmod=sha256) 5 return json.dumps({ 6 "response_token": "sha256="+b64encode(h.digest()).decode() 7 }) 8 9 def verify_request(event, context): 10 crc = event['headers']['X-Twitter-Webhooks-Signature'] 11 h = hmac.new( 12 bytes(CONSUMER_SECRET, 'ascii'), 13 bytes(event['body'], 'utf-8'), 14 digestmod=sha256) 15 crc = b64decode(crc[7:]) # strip out the first 7 characters ("sha256=") 16 return hmac.compare_digest(h.digest(), crc)
  • 50. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Lambda Function – SageMaker and Twitter 1 def lambda_handler(events, context): 2 # we're good! load that event up 3 twitter_events = json.loads(event['body']) 4 for event in twitter_events.get('tweet_create_events', []): 5 if validate_record(event): 6 body = json.dumps({'url': media, 'max_predictions': MAX_PREDICTIONS}) 7 results = json.loads( 8 sagemaker.invoke_endpoint(EndpointName=ENDPOINT_NAME, Body=body) 9 )['Body'].read() 10 status = build_tweet(results) 11 twitter_api.PostUpdate( 12 " ?n" + status[0], 13 media=status[1], 14 in_reply_to_status_id=event['id_str'], 15 auto_populate_reply_metadata=True 16 )
  • 51. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt SageMaker Architecture • Docker container stored in ECR • Autoscaling Endpoint spins up containers as needed and automatically fetches model artifacts from S3 and puts them in /opt/models • Flask app responds to /ping and /inference Amazon SageMaker Model Artifacts Inference Endpoint Inference code Amazon ECR Inference code
  • 52. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt SageMaker Inference Code – Load Model 1 import mxnet as mx 2 import numpy as np 3 sym, arg_params, aux_params = mx.model.load_checkpoint(MODEL_NAME, 12) 4 mod = mx.mod.Module(symbol=sym, context=mx.cpu()) 5 mod.bind([('data', (1, 3, 224, 224))], for_training=False) 6 mod.set_params(arg_params, aux_params, allow_missing=True) 7 Batch = namedtuple('Batch', ['data']) 8 grids = load_grids()
  • 53. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt SageMaker Inference Code – Predict 1 def predict(img, max_predictions): 2 mod.forward(Batch(img), is_train=False) 3 prob = mod.get_outputs()[0].asnumpy()[0] 4 pred = np.argsort(prob)[::-1] 5 result = [] 6 for i in range(max_predictions): 7 pred_loc = grids[int(pred[i])] 8 result.append((pred_loc, prob[])) 9 return result 10 11 def download_and_predict(url, max_predictions=3): 12 img = preprocess_image(download_image(url)) 13 return predict(img, max_predictions)
  • 54. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt SageMaker Inference Code – Flask App 1 from flask import request, jsonify, Flask 2 import predict 3 app = Flask("WhereML") 4 5 @app.route("/ping") 6 def ping(): 7 return "", 200 8 9 @app.route("/invocations", methods=["POST"]) 10 def invoke(): 11 data = request.get_json(force=True) 12 return jsonify(predict.download_and_predict(data['url']))
  • 55. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt SageMaker Inference Code – Docker File 1 FROM mxnet/python:latest 2 WORKDIR /app 3 RUN pip install -U flask scikit-image numpy reverse_geocoder boto3 4 COPY *.py /app/ 5 COPY grids.txt /app/ 6 ENTRYPOINT ["python", "app.py"] 7 EXPOSE 8080
  • 56. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Working with Twitter
  • 57. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Twitter API • Two ways to respond to mentions: User Streams API (deprecated) and Account Activity API (beta) • Account Activity Webhooks allow fully “serverless” approach • UserStreams API requires running container/instance to poll for updates • UserStreams API is going away in June 2018… even though the replacement for it is not GA…
  • 58. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Registering Webhook 1 twitter = OAuth1Session(**keys) 2 base_url = "https://api.twitter.com/1.1/all/env-beta/" 3 params={'url': "https://mywebsite.com/twitter/whereml"} 4 webhook_id = twitter.post(base_url+"webhooks.json", params).json()['id'] 5 # pass webhook ID in prod, not needed in beta 6 twitter.post(base_url+"subscriptions.json")
  • 59. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt SageMaker Notebooks Training Algorithm SageMaker Training Amazon ECR Code Commit Code Pipeline SageMaker Hosting dataset AWS Lambda API Gateway SageMaker Example End-to-End Architecture Build Train Deploy static website hosted on S3 Inference requests Amazon S3 Amazon Cloudfront Web assets on Cloudfront
  • 60. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Easy to get started! Tons of tools Machine Learning is FUN
  • 61. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Built live on twitch.tv/aws
  • 62. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. @jrhunt Thank you! randhunt@amazon.com