SlideShare une entreprise Scribd logo
1  sur  42
Télécharger pour lire hors ligne
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Smarter Event-Driven Edge with
Amazon SageMaker & Project Flogo
Matt Ellis
Director Product & Strategy
TIBCO Software, Inc.
A I M 2 0 4 - S
Abram Van Der Geest
Machine Learning Product Manager
TIBCO Software, Inc.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
What’s an event, anyway?
Making sense of events
Machine learning, deep learning … Help me out here!
The event-driven ecosystem: Project Flogo®
Accelerometer example: The data
Accelerometer example: Training with Amazon SageMaker
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Event-driven by design
e·vent
əˈvent/
noun
noun: event; plural noun: events
- A thing that happens, especially one of importance
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Event-processing premise
The simple notion is that an event is just that, an event.
Whether it be one or millions, it’s how you process them
that differs.
Stream: Aggregate/Filter Noise Integrate Correlate & Rules
If (….)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Making sense of events
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
All hail, the king … Data
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Sensors everywhere
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
New app architecture paradigms
Monolith Microservices Functions
Hard to change Easier
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Smart applications
Or so they say ...
Traditional software
AI
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Does this mean that ML is always the answer?
Streaming: Data Aggregation
• Median, mean, time-weighted averages,
variability/robustness
• Sometimes streaming data analytics in
real time is sufficient for your problem!
Machine Learning (ML)
• Classify large quantities of data,
such as images and text
• Broad set of patterns need to be
detected
• Sufficient data must be available
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
DL, AI, ML … Huh?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ML: Supervised vs. Unsupervised
Supervised
• Model known problems: y=f(x)
• Predicts an observed condition
For example: What factors are driving failures?
• Requires lots of labeled data
• Subsets of supervised learning:
Semi-supervised Learning: Using an incomplete
training signal
Active learning: Optimizes choice of objects requiring
labels
Reinforcement learning: Based on rewards and
punishment
Unsupervised
• Explore observed data: x only
• Understand structure, detect anomalies
Are there new patterns/failure modes emerging?
• Often used to uncover new phenomenon
• Feature choices drastically change information
extracted
• Can be goal in itself (new patterns) or to discover
features for supervised learning
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ML: Applications
14
Classification
● Spam detection
● Activity detection
● Fraud detection
● Bucketing
● Recommendation engines
● And so on
Regression
● Any graph fitting
● Numeric prediction
● Value estimation
● And so on
Clustering/Pattern Recognition
● Class discovery
● Feature discovery
● And so on
Dimensionality Reduction
● Feature importance
● Feature reduction/selection
● Optimization other ML (less
dimensions = faster)
● Noise reduction
● Word embeddings
● And so on
Outlier/Anomaly Detection
● Fraud detection
● Network intrusion detection
● Failure mode detection
● Discover trending topics
● And so on
Information Filtering
● Recommendation engines
● Collaborative filters
● Security investigation
● Improve signal-to-noise- ratio
of data
● And so on
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Machine Learning, AI, Neural Networks, & Deep
Learning
15
Sizes are largely arbitrary
ML
AI
DL
NN
Definitions
● Machine Learning: Algorithms “focused” on learning from data to provide
insights
● Artificial Intelligence (AI): Computer systems that perform tasks that replicate
human intelligence and activities
● Neural Networks: A class of algorithms originally modeled off the human
brain that uses networks of linear algebra operations to perform human-
like ML tasks
● Deep Learning: A hierarchical form of neural networks (read multi-layer NN)
to learn data representations successful in computer vision, speech
recognition, and NLP
Notes
● All four terms have incorrectly been used interchangeably
● Some consider ML a subset of AI, others vise versa
● Forms of AI exist that do not rely on ML (for example, rules based)
● NN and DL consist of algorithms (loosely) modeled off the human brain to
perform human actions
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Project Flogo: Event-driven
Ecosystem
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Project Flogo®
Project Flogo®
Open Source Ecosystem for Event-driven Apps
10-50x lighter than
Java, .NET, or Node.js
100% Open Source Stack
for all things event-driven
Common core for all event-
driven capabilities
Deploy as serverless
functions, containers, or to
IoT Edge devices
Machine Learning
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Integration Flows
Stream Processing
Microgateway
Contextual Rules
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Flogo® Core
⚡
️
Powerful event-driven
programming model based on
triggers and actions.
Internal channel for action
chaining. Bundle all app needs
into a single bin.
Common contribution model
enabling you to leverage 100s of
activities & triggers.
Simple interface to extend event
processing capabilities.
Flogo Core
Event-driven App Kernel for Serverless & IoT Edge
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Integration Flows
Ultra-lightweight App Integration for Serverless and Edge
Conditional control flowUltralight Process Engine for
application integration
Powerful step-back
debugging capabilities in web
browser
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Process Engine
Manages control-flow
Determines how & when activities are executed
Manages state changes
Persists state changes into state service
Everything is a branch … Conditions are optional
PubKafkaWriteDBLog
WebSocket SQLWrite
Conditional Logic
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Flogo Flows Web UI
Low-friction UX
• Express app logic using rich
flows, not just data or
request pipelines
• Inline data transformations
• Built-in web-based
debugger
• Build for target platform
directly from UI
• Available on Docker Hub or
Flogo.io
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Flogo Streams
Stream Pipeline for Edge & Cloud-native
Lightweight stream process
for Edge devices
f(x)
Aggregation capabilities Join streams from multiple
event sources
Filter out the noise
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Aggregate Filter
Inference
AI/ML
Grouping & joining events across triggers
With Flogo Streams you can group & join events across multiple
different streams of data
Joins occur against pipeline input/output
Kafka
MQTT
GPIO
Aggregate Filter
Inference
AI/ML
Aggregate Filter
Inference
AI/ML
group: $input.deviceId
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Aggregation
Tumbling Windows
Sliding Window
Accumulate f(x)
Operations:
• Tumbling
• Time Tumbling
• Sliding
• Time Sliding
Functions:
• avg, sum, min, max, count,
accumulate
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Rules Action for Flogo
Real-time Contextual Decisions
Real-time decisions to
determine next best
action/outcome and
experience
Open source/core complete
with extensions, APIs, and
interfaces
Declarative rules/rapid
application development
Stateful/contextual
reasoning across time and
space
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Machine Learning Capabilities
Execute TensorFlow
models
100% open source with
zero lock-in
Native Machine Learning
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
TensorFlow Inferencing
Model
Model metadata, features, data
type and dimensions, and so on
Framework
Interface and factory for
framework implementations
TensorFlow
Concrete TensorFlow
implementation
?
Other ML/DL framework
TensorFlow Go Lib
• SavedModel format
• SigDef, operations, input and
output tensors, & dimensions
• Activity parses the
SavedModel metadata
• Support for dense features
• The TensorFlow wrapper
parses and validates input
feature set and dt
Generic Interfaces
ParseExample pb
The protobuff used as input to the
operations. Go structs generated from
pb
Flogo
TensorFlow
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SavedModel Metadata
MetaGraphDef with tag-set: 'serve' contains the following SignatureDefs:
signature_def['default_input_alternative:None']:
The given SavedModel SignatureDef contains the following input(s):
inputs['inputs'] tensor_info:
dtype: DT_STRING
shape: (-1)
name: input_example_tensor:0
The given SavedModel SignatureDef contains the following output(s):
outputs['classes'] tensor_info:
dtype: DT_STRING
shape: (-1, 3)
name:dnn/multi_class_head/_classification_output_alternatives/classes_tensor:0
outputs['scores'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 3)
name: dnn/multi_class_head/predictions/probabilities:0
Method name is: tensorflow/serving/classify
Input tensor with name and data
type. This should be a serialized
example protobuf.
Output tensor for the
classification.
Output tensor for the score
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Google TensorFlow™ API
TF can be operated at several levels
Raw Graph level
Tensors and operations added to the graph programmatically
The session run against the graph
Issue: Large amounts of code often produced to do anything
Introducing … The Estimator
Higher-level abstraction
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
So, why ML @ the Edge?
• Data Volume, Generation
– Data collection exceeds ability to transport
• Intelligent Aggregation
– Reduces transfer & storage costs
– Smarter, more efficient networks
• Predictions
– Smarter device actions, less network latency
– Actions resilient to network connectivity issues
The Issues:
• Prediction Lag
• Massive Data Transfers
• Connectivity Requirements
Devices
Gateway Clouddata @ millis
Action
Aggregates
Prediction
… ML challenges amplify the issues of IoT integration!
Store and train
models here
… Or here
Analytics can
happen here
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The Demo Scenario
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Accelerometer: Scenario
Create a model that accurately classifies the activity of a box as in motion,
stationary, or dropped/thrown
Explore sample data
Create labeled data set
Build/train model
Validate results
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Accelerometer: Explore sample data
Dropped/Thrown
Moving
Sitting
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Accelerometer: Create labeled data set
Drop
Drop
Moving Stationary
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Accelerometer: Training/TF Model/Results
● Features (ax,ay,az,amag) lagged 10 steps
● Each time step (set of lagged features) treated
independently
● Shuffle time steps
● 80/20 train - test split
80%
Train
20%
Test
clf = tf.estimator.DNNClassifier(model_dir=model_output_loc,
hidden_units=[100,40,3],
feature_columns=feat_cols,
n_classes= len(label_names) ,
label_vocabulary= label_names,
optimizer= tf.train.ProximalAdagradOptimizer(learning_rate=learn_rate,
l1_regularization_strength=0.001))
clf.train(input_fn=get_input_fn_from_pandas(train),steps=10000)
90+%
Accuracy
● Classifications:
○ Sitting/Moving/Dropped or Thrown
● 90% Accuracy (with transitions included)
● 99% Accuracy (leaving transitions out)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
All right, let’s train an ML model!
... Or is it?
This is gonna
take awhile ...
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Demo Scenario
Aggregate
(50ms avg)
ADXL345
Aggregate
(Lagx10)
Feature
Eng
ML
inference
Dropped Too
Much
Missing Movement
Event
WSMsgLog
Pub Channel
Stream
Rules
Flow
Rule
Channel
PublishRes
Channel
Local fact storage
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Getting started with Flogo & Amazon SageMaker
github.com/TIBCOSoftware/flogo github.com/awslabs/amazon-sagemaker-
examples
Amazon SageMaker Free Tier:
● 250 hours ml.t2.medium notebooks
● 50 hours ml.m4.xlarge training
● Combined total of 125 hours ml.m4.xlarge
hosting
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Key Takeaways
• Predictions are deployed and executed on the device with minimal
overhead!
• No dependency on cloud resource for the inferencing
• Streaming functionality to facilitate use cases and act as a data
preprocessor for ML inferencing
• Accelerometer example may be specific – but the concept & approach is
general and can be applied to a variety of problems
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Matt Ellis
Director Product & Strategy
TIBCO Software, Inc.
Abram Van Der Geest
Machine Learning Product
Manager
TIBCO Software, Inc.
GitHub: abramvandergeest
GitHub: mellistibco
Twitter: @mellismi
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Contenu connexe

Tendances

Tendances (20)

Leadership Session: Digital Advertising - Customer Learning & the Road Ahead ...
Leadership Session: Digital Advertising - Customer Learning & the Road Ahead ...Leadership Session: Digital Advertising - Customer Learning & the Road Ahead ...
Leadership Session: Digital Advertising - Customer Learning & the Road Ahead ...
 
Hollywood's Cloud-Based Content Lakes: Modernized Media Archives (MAE203) - A...
Hollywood's Cloud-Based Content Lakes: Modernized Media Archives (MAE203) - A...Hollywood's Cloud-Based Content Lakes: Modernized Media Archives (MAE203) - A...
Hollywood's Cloud-Based Content Lakes: Modernized Media Archives (MAE203) - A...
 
Create a Serverless Searchable Media Library (AIM342-R1) - AWS re:Invent 2018
Create a Serverless Searchable Media Library (AIM342-R1) - AWS re:Invent 2018Create a Serverless Searchable Media Library (AIM342-R1) - AWS re:Invent 2018
Create a Serverless Searchable Media Library (AIM342-R1) - AWS re:Invent 2018
 
Bring Your Own Apache MXNet and TensorFlow Scripts to Amazon SageMaker (AIM35...
Bring Your Own Apache MXNet and TensorFlow Scripts to Amazon SageMaker (AIM35...Bring Your Own Apache MXNet and TensorFlow Scripts to Amazon SageMaker (AIM35...
Bring Your Own Apache MXNet and TensorFlow Scripts to Amazon SageMaker (AIM35...
 
Capture Voice of Customer Insights with NLP & Analytics (AIM415-R1) - AWS re:...
Capture Voice of Customer Insights with NLP & Analytics (AIM415-R1) - AWS re:...Capture Voice of Customer Insights with NLP & Analytics (AIM415-R1) - AWS re:...
Capture Voice of Customer Insights with NLP & Analytics (AIM415-R1) - AWS re:...
 
Run XGBoost with Amazon SageMaker (AIM335) - AWS re:Invent 2018
Run XGBoost with Amazon SageMaker (AIM335) - AWS re:Invent 2018Run XGBoost with Amazon SageMaker (AIM335) - AWS re:Invent 2018
Run XGBoost with Amazon SageMaker (AIM335) - AWS re:Invent 2018
 
Human-in-the-Loop for Machine Learning (AIM358-R1) - AWS re:Invent 2018
Human-in-the-Loop for Machine Learning (AIM358-R1) - AWS re:Invent 2018Human-in-the-Loop for Machine Learning (AIM358-R1) - AWS re:Invent 2018
Human-in-the-Loop for Machine Learning (AIM358-R1) - AWS re:Invent 2018
 
Deep Learning Applications Using PyTorch, Featuring Facebook (AIM402-R) - AWS...
Deep Learning Applications Using PyTorch, Featuring Facebook (AIM402-R) - AWS...Deep Learning Applications Using PyTorch, Featuring Facebook (AIM402-R) - AWS...
Deep Learning Applications Using PyTorch, Featuring Facebook (AIM402-R) - AWS...
 
Machine Learning and Predictive Quality Management (AIM311) - AWS re:Invent 2018
Machine Learning and Predictive Quality Management (AIM311) - AWS re:Invent 2018Machine Learning and Predictive Quality Management (AIM311) - AWS re:Invent 2018
Machine Learning and Predictive Quality Management (AIM311) - AWS re:Invent 2018
 
Build Deep Learning Applications Using PyTorch and Amazon SageMaker (AIM432-R...
Build Deep Learning Applications Using PyTorch and Amazon SageMaker (AIM432-R...Build Deep Learning Applications Using PyTorch and Amazon SageMaker (AIM432-R...
Build Deep Learning Applications Using PyTorch and Amazon SageMaker (AIM432-R...
 
Detect Anomalies Using Amazon SageMaker (AIM420) - AWS re:Invent 2018
Detect Anomalies Using Amazon SageMaker (AIM420) - AWS re:Invent 2018Detect Anomalies Using Amazon SageMaker (AIM420) - AWS re:Invent 2018
Detect Anomalies Using Amazon SageMaker (AIM420) - AWS re:Invent 2018
 
Amazon, awsreinvent2018, Artificial Intelligence & Machine Learning, AIM422, ...
Amazon, awsreinvent2018, Artificial Intelligence & Machine Learning, AIM422, ...Amazon, awsreinvent2018, Artificial Intelligence & Machine Learning, AIM422, ...
Amazon, awsreinvent2018, Artificial Intelligence & Machine Learning, AIM422, ...
 
Use Amazon Rekognition to Power Video Creative Asset Production (ADT202) - AW...
Use Amazon Rekognition to Power Video Creative Asset Production (ADT202) - AW...Use Amazon Rekognition to Power Video Creative Asset Production (ADT202) - AW...
Use Amazon Rekognition to Power Video Creative Asset Production (ADT202) - AW...
 
Democratize Data Preparation for Analytics & Machine Learning A Hands-On Lab ...
Democratize Data Preparation for Analytics & Machine Learning A Hands-On Lab ...Democratize Data Preparation for Analytics & Machine Learning A Hands-On Lab ...
Democratize Data Preparation for Analytics & Machine Learning A Hands-On Lab ...
 
Build an Intelligent Multi-Modal User Agent with Voice and NLU (AIM340) - AWS...
Build an Intelligent Multi-Modal User Agent with Voice and NLU (AIM340) - AWS...Build an Intelligent Multi-Modal User Agent with Voice and NLU (AIM340) - AWS...
Build an Intelligent Multi-Modal User Agent with Voice and NLU (AIM340) - AWS...
 
Robocar Rally 2018 (AIM206-R20) - AWS re:Invent 2018
Robocar Rally 2018 (AIM206-R20) - AWS re:Invent 2018Robocar Rally 2018 (AIM206-R20) - AWS re:Invent 2018
Robocar Rally 2018 (AIM206-R20) - AWS re:Invent 2018
 
Detecting Financial Market Manipulation Using Machine Learning (AIM347) - AWS...
Detecting Financial Market Manipulation Using Machine Learning (AIM347) - AWS...Detecting Financial Market Manipulation Using Machine Learning (AIM347) - AWS...
Detecting Financial Market Manipulation Using Machine Learning (AIM347) - AWS...
 
Machine Learning Your Eight-Year-Old Would Be Proud Of (AIM390) - AWS re:Inve...
Machine Learning Your Eight-Year-Old Would Be Proud Of (AIM390) - AWS re:Inve...Machine Learning Your Eight-Year-Old Would Be Proud Of (AIM390) - AWS re:Inve...
Machine Learning Your Eight-Year-Old Would Be Proud Of (AIM390) - AWS re:Inve...
 
Machine Learning at the Edge (AIM302) - AWS re:Invent 2018
Machine Learning at the Edge (AIM302) - AWS re:Invent 2018Machine Learning at the Edge (AIM302) - AWS re:Invent 2018
Machine Learning at the Edge (AIM302) - AWS re:Invent 2018
 
Build a Babel Fish with Machine Learning Language Services (AIM313) - AWS re:...
Build a Babel Fish with Machine Learning Language Services (AIM313) - AWS re:...Build a Babel Fish with Machine Learning Language Services (AIM313) - AWS re:...
Build a Babel Fish with Machine Learning Language Services (AIM313) - AWS re:...
 

Similaire à Smarter Event-Driven Edge with Amazon SageMaker & Project Flogo (AIM204-S) - AWS re:Invent 2018

Similaire à Smarter Event-Driven Edge with Amazon SageMaker & Project Flogo (AIM204-S) - AWS re:Invent 2018 (20)

Introducing Amazon SageMaker - AWS Online Tech Talks
Introducing Amazon SageMaker - AWS Online Tech TalksIntroducing Amazon SageMaker - AWS Online Tech Talks
Introducing Amazon SageMaker - AWS Online Tech Talks
 
雲端推動的人工智能革命
雲端推動的人工智能革命雲端推動的人工智能革命
雲端推動的人工智能革命
 
Image Recognition Real World Applications
Image Recognition Real World ApplicationsImage Recognition Real World Applications
Image Recognition Real World Applications
 
Come costruire una soluzione Digital Twin con AWS IoT e AI-ML
Come costruire una soluzione Digital Twin con AWS IoT e AI-MLCome costruire una soluzione Digital Twin con AWS IoT e AI-ML
Come costruire una soluzione Digital Twin con AWS IoT e AI-ML
 
How Trupanion Became an AI-driven Company for Pets
How Trupanion Became an AI-driven Company for PetsHow Trupanion Became an AI-driven Company for Pets
How Trupanion Became an AI-driven Company for Pets
 
Introduction to Machine Learning on Mobile: Mobile Week SF
Introduction to Machine Learning on Mobile: Mobile Week SFIntroduction to Machine Learning on Mobile: Mobile Week SF
Introduction to Machine Learning on Mobile: Mobile Week SF
 
Machine Learning on Mobile
Machine Learning on MobileMachine Learning on Mobile
Machine Learning on Mobile
 
Machine Learning on Mobile
Machine Learning on MobileMachine Learning on Mobile
Machine Learning on Mobile
 
AWS AI state of the union - AWS Cape Town Summit 2018
AWS AI state of the union - AWS Cape Town Summit 2018AWS AI state of the union - AWS Cape Town Summit 2018
AWS AI state of the union - AWS Cape Town Summit 2018
 
An Overview of Machine Learning on AWS
An Overview of Machine Learning on AWSAn Overview of Machine Learning on AWS
An Overview of Machine Learning on AWS
 
AI Powered Conversational Interfaces
AI Powered Conversational InterfacesAI Powered Conversational Interfaces
AI Powered Conversational Interfaces
 
AIoT: AI Meets IoT (IOT204) - AWS re:Invent 2018
AIoT: AI Meets IoT (IOT204) - AWS re:Invent 2018AIoT: AI Meets IoT (IOT204) - AWS re:Invent 2018
AIoT: AI Meets IoT (IOT204) - AWS re:Invent 2018
 
Quickly and easily build, train, and deploy machine learning models at any scale
Quickly and easily build, train, and deploy machine learning models at any scaleQuickly and easily build, train, and deploy machine learning models at any scale
Quickly and easily build, train, and deploy machine learning models at any scale
 
MLops workshop AWS
MLops workshop AWSMLops workshop AWS
MLops workshop AWS
 
Introduction to Sagemaker
Introduction to SagemakerIntroduction to Sagemaker
Introduction to Sagemaker
 
Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...
Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...
Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...
 
Dennis Hills - Top 5 Ways to Build Machine Learning Prediction on the Edge fo...
Dennis Hills - Top 5 Ways to Build Machine Learning Prediction on the Edge fo...Dennis Hills - Top 5 Ways to Build Machine Learning Prediction on the Edge fo...
Dennis Hills - Top 5 Ways to Build Machine Learning Prediction on the Edge fo...
 
Top 4 Ways to Build Machine Learning Prediction on the Edge for Mobile & IoT
Top 4 Ways to Build Machine Learning Prediction on the Edge for Mobile & IoTTop 4 Ways to Build Machine Learning Prediction on the Edge for Mobile & IoT
Top 4 Ways to Build Machine Learning Prediction on the Edge for Mobile & IoT
 
Driving Machine Learning and Analytics Use Cases with AWS Storage (STG302) - ...
Driving Machine Learning and Analytics Use Cases with AWS Storage (STG302) - ...Driving Machine Learning and Analytics Use Cases with AWS Storage (STG302) - ...
Driving Machine Learning and Analytics Use Cases with AWS Storage (STG302) - ...
 
Artificial Intelligence nella realtà di oggi: come utilizzarla al meglio
Artificial Intelligence nella realtà di oggi: come utilizzarla al meglioArtificial Intelligence nella realtà di oggi: come utilizzarla al meglio
Artificial Intelligence nella realtà di oggi: come utilizzarla al meglio
 

Plus de Amazon 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 AWS
Amazon 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 Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon 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
 

Plus 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
 

Smarter Event-Driven Edge with Amazon SageMaker & Project Flogo (AIM204-S) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Smarter Event-Driven Edge with Amazon SageMaker & Project Flogo Matt Ellis Director Product & Strategy TIBCO Software, Inc. A I M 2 0 4 - S Abram Van Der Geest Machine Learning Product Manager TIBCO Software, Inc.
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Agenda What’s an event, anyway? Making sense of events Machine learning, deep learning … Help me out here! The event-driven ecosystem: Project Flogo® Accelerometer example: The data Accelerometer example: Training with Amazon SageMaker
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event-driven by design e·vent əˈvent/ noun noun: event; plural noun: events - A thing that happens, especially one of importance © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event-processing premise The simple notion is that an event is just that, an event. Whether it be one or millions, it’s how you process them that differs. Stream: Aggregate/Filter Noise Integrate Correlate & Rules If (….)
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Making sense of events
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. All hail, the king … Data
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Sensors everywhere
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. New app architecture paradigms Monolith Microservices Functions Hard to change Easier
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Smart applications Or so they say ... Traditional software AI
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Does this mean that ML is always the answer? Streaming: Data Aggregation • Median, mean, time-weighted averages, variability/robustness • Sometimes streaming data analytics in real time is sufficient for your problem! Machine Learning (ML) • Classify large quantities of data, such as images and text • Broad set of patterns need to be detected • Sufficient data must be available
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. DL, AI, ML … Huh?
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ML: Supervised vs. Unsupervised Supervised • Model known problems: y=f(x) • Predicts an observed condition For example: What factors are driving failures? • Requires lots of labeled data • Subsets of supervised learning: Semi-supervised Learning: Using an incomplete training signal Active learning: Optimizes choice of objects requiring labels Reinforcement learning: Based on rewards and punishment Unsupervised • Explore observed data: x only • Understand structure, detect anomalies Are there new patterns/failure modes emerging? • Often used to uncover new phenomenon • Feature choices drastically change information extracted • Can be goal in itself (new patterns) or to discover features for supervised learning
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ML: Applications 14 Classification ● Spam detection ● Activity detection ● Fraud detection ● Bucketing ● Recommendation engines ● And so on Regression ● Any graph fitting ● Numeric prediction ● Value estimation ● And so on Clustering/Pattern Recognition ● Class discovery ● Feature discovery ● And so on Dimensionality Reduction ● Feature importance ● Feature reduction/selection ● Optimization other ML (less dimensions = faster) ● Noise reduction ● Word embeddings ● And so on Outlier/Anomaly Detection ● Fraud detection ● Network intrusion detection ● Failure mode detection ● Discover trending topics ● And so on Information Filtering ● Recommendation engines ● Collaborative filters ● Security investigation ● Improve signal-to-noise- ratio of data ● And so on
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Machine Learning, AI, Neural Networks, & Deep Learning 15 Sizes are largely arbitrary ML AI DL NN Definitions ● Machine Learning: Algorithms “focused” on learning from data to provide insights ● Artificial Intelligence (AI): Computer systems that perform tasks that replicate human intelligence and activities ● Neural Networks: A class of algorithms originally modeled off the human brain that uses networks of linear algebra operations to perform human- like ML tasks ● Deep Learning: A hierarchical form of neural networks (read multi-layer NN) to learn data representations successful in computer vision, speech recognition, and NLP Notes ● All four terms have incorrectly been used interchangeably ● Some consider ML a subset of AI, others vise versa ● Forms of AI exist that do not rely on ML (for example, rules based) ● NN and DL consist of algorithms (loosely) modeled off the human brain to perform human actions
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Project Flogo: Event-driven Ecosystem
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Project Flogo® Project Flogo® Open Source Ecosystem for Event-driven Apps 10-50x lighter than Java, .NET, or Node.js 100% Open Source Stack for all things event-driven Common core for all event- driven capabilities Deploy as serverless functions, containers, or to IoT Edge devices Machine Learning
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Integration Flows Stream Processing Microgateway Contextual Rules
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Flogo® Core ⚡ ️ Powerful event-driven programming model based on triggers and actions. Internal channel for action chaining. Bundle all app needs into a single bin. Common contribution model enabling you to leverage 100s of activities & triggers. Simple interface to extend event processing capabilities. Flogo Core Event-driven App Kernel for Serverless & IoT Edge
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Integration Flows Ultra-lightweight App Integration for Serverless and Edge Conditional control flowUltralight Process Engine for application integration Powerful step-back debugging capabilities in web browser
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Process Engine Manages control-flow Determines how & when activities are executed Manages state changes Persists state changes into state service Everything is a branch … Conditions are optional PubKafkaWriteDBLog WebSocket SQLWrite Conditional Logic
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Flogo Flows Web UI Low-friction UX • Express app logic using rich flows, not just data or request pipelines • Inline data transformations • Built-in web-based debugger • Build for target platform directly from UI • Available on Docker Hub or Flogo.io
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Flogo Streams Stream Pipeline for Edge & Cloud-native Lightweight stream process for Edge devices f(x) Aggregation capabilities Join streams from multiple event sources Filter out the noise
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aggregate Filter Inference AI/ML Grouping & joining events across triggers With Flogo Streams you can group & join events across multiple different streams of data Joins occur against pipeline input/output Kafka MQTT GPIO Aggregate Filter Inference AI/ML Aggregate Filter Inference AI/ML group: $input.deviceId
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aggregation Tumbling Windows Sliding Window Accumulate f(x) Operations: • Tumbling • Time Tumbling • Sliding • Time Sliding Functions: • avg, sum, min, max, count, accumulate
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Rules Action for Flogo Real-time Contextual Decisions Real-time decisions to determine next best action/outcome and experience Open source/core complete with extensions, APIs, and interfaces Declarative rules/rapid application development Stateful/contextual reasoning across time and space
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Machine Learning Capabilities Execute TensorFlow models 100% open source with zero lock-in Native Machine Learning
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. TensorFlow Inferencing Model Model metadata, features, data type and dimensions, and so on Framework Interface and factory for framework implementations TensorFlow Concrete TensorFlow implementation ? Other ML/DL framework TensorFlow Go Lib • SavedModel format • SigDef, operations, input and output tensors, & dimensions • Activity parses the SavedModel metadata • Support for dense features • The TensorFlow wrapper parses and validates input feature set and dt Generic Interfaces ParseExample pb The protobuff used as input to the operations. Go structs generated from pb Flogo TensorFlow
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. SavedModel Metadata MetaGraphDef with tag-set: 'serve' contains the following SignatureDefs: signature_def['default_input_alternative:None']: The given SavedModel SignatureDef contains the following input(s): inputs['inputs'] tensor_info: dtype: DT_STRING shape: (-1) name: input_example_tensor:0 The given SavedModel SignatureDef contains the following output(s): outputs['classes'] tensor_info: dtype: DT_STRING shape: (-1, 3) name:dnn/multi_class_head/_classification_output_alternatives/classes_tensor:0 outputs['scores'] tensor_info: dtype: DT_FLOAT shape: (-1, 3) name: dnn/multi_class_head/predictions/probabilities:0 Method name is: tensorflow/serving/classify Input tensor with name and data type. This should be a serialized example protobuf. Output tensor for the classification. Output tensor for the score
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Google TensorFlow™ API TF can be operated at several levels Raw Graph level Tensors and operations added to the graph programmatically The session run against the graph Issue: Large amounts of code often produced to do anything Introducing … The Estimator Higher-level abstraction
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. So, why ML @ the Edge? • Data Volume, Generation – Data collection exceeds ability to transport • Intelligent Aggregation – Reduces transfer & storage costs – Smarter, more efficient networks • Predictions – Smarter device actions, less network latency – Actions resilient to network connectivity issues The Issues: • Prediction Lag • Massive Data Transfers • Connectivity Requirements Devices Gateway Clouddata @ millis Action Aggregates Prediction … ML challenges amplify the issues of IoT integration! Store and train models here … Or here Analytics can happen here
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. The Demo Scenario
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Accelerometer: Scenario Create a model that accurately classifies the activity of a box as in motion, stationary, or dropped/thrown Explore sample data Create labeled data set Build/train model Validate results
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Accelerometer: Explore sample data Dropped/Thrown Moving Sitting
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Accelerometer: Create labeled data set Drop Drop Moving Stationary
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Accelerometer: Training/TF Model/Results ● Features (ax,ay,az,amag) lagged 10 steps ● Each time step (set of lagged features) treated independently ● Shuffle time steps ● 80/20 train - test split 80% Train 20% Test clf = tf.estimator.DNNClassifier(model_dir=model_output_loc, hidden_units=[100,40,3], feature_columns=feat_cols, n_classes= len(label_names) , label_vocabulary= label_names, optimizer= tf.train.ProximalAdagradOptimizer(learning_rate=learn_rate, l1_regularization_strength=0.001)) clf.train(input_fn=get_input_fn_from_pandas(train),steps=10000) 90+% Accuracy ● Classifications: ○ Sitting/Moving/Dropped or Thrown ● 90% Accuracy (with transitions included) ● 99% Accuracy (leaving transitions out)
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. All right, let’s train an ML model! ... Or is it? This is gonna take awhile ... © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Demo Scenario Aggregate (50ms avg) ADXL345 Aggregate (Lagx10) Feature Eng ML inference Dropped Too Much Missing Movement Event WSMsgLog Pub Channel Stream Rules Flow Rule Channel PublishRes Channel Local fact storage
  • 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Getting started with Flogo & Amazon SageMaker github.com/TIBCOSoftware/flogo github.com/awslabs/amazon-sagemaker- examples Amazon SageMaker Free Tier: ● 250 hours ml.t2.medium notebooks ● 50 hours ml.m4.xlarge training ● Combined total of 125 hours ml.m4.xlarge hosting
  • 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Key Takeaways • Predictions are deployed and executed on the device with minimal overhead! • No dependency on cloud resource for the inferencing • Streaming functionality to facilitate use cases and act as a data preprocessor for ML inferencing • Accelerometer example may be specific – but the concept & approach is general and can be applied to a variety of problems
  • 41. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Matt Ellis Director Product & Strategy TIBCO Software, Inc. Abram Van Der Geest Machine Learning Product Manager TIBCO Software, Inc. GitHub: abramvandergeest GitHub: mellistibco Twitter: @mellismi
  • 42. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.