Machine Learning
for Developers
Danilo Poccia, Technical Evangelist
@danilop
danilop
Credit: Gerry Cranham/Fox Photos/Getty Images
http://www.telegraph.co.uk/travel/destinations/europe/united-kingdom/england/london/galleries/The-history-of-the-Tube-in-pictures-150-years-of-London-Underground/1939-ticket-examin/
Credit: Gerry Cranham/Fox Photos/Getty Images
http://www.telegraph.co.uk/travel/destinations/europe/united-kingdom/england/london/galleries/The-history-of-the-Tube-in-pictures-150-years-of-London-Underground/1939-ticket-examin/
1939 London Underground
Batch
Report
Batch
Report
Real-time
Alerts
Batch
Report
Real-time
Alerts
Prediction
Forecast
Predictions
Data Predictions
ModelData Predictions
Model
Machine Learning
Supervised
Learning
Machine Learning
Unsupervised
Learning
The task of inferring
a model
from labeled
training data
The task of inferring
a model
to describe
hidden structure
from unlabeled data
Reinforcement
Learning
Perform
a certain goal in a
dynamic environment,
without an explicit
“teacher”
Driving a vehicle
Playing a game

against an opponent
R
einforcem
ent
Learning
Clustering
U
nsupervised

Learning
Clustering
U
nsupervised

Learning
Clustering
U
nsupervised

Learning
Regression
Binary Classication
Multi-class Classication
Supervised

Learning
Validation
Supervised

Learning
Training from Labeled Data
Supervised

Learning
Training
Validation
70%
30%
Be Careful of Overtting
Supervised

Learning
Be Careful of Overtting
Supervised

Learning
Be Careful of Overtting
Supervised

Learning
Better Model,
Different Predictions
Supervised

Learning
Better Model
Supervised

Learning
?Data Model
Amazon EMR
with Spark (MLib)
Data Model
<demo>
...
</demo>
Recommender: An Analysis of
Collaborative Filtering Techniques
Christopher R. Aberger
http://stanford.io/28OR3XE
M
ore
Info
Amazon EMR
with Spark (MLib)
Data Model
Data Scientists
“Scalability”
Amazon

Machine Learning

(Amazon ML)
Data Model
Amazon

Machine Learning

(Amazon ML)
Data Model
Batch
Predictions
Amazon

Machine Learning

(Amazon ML)
Data Model
Batch
Predictions
Real-time
Predictions
Binary Classication
Multiclass
Classication
Regression
Logistic Regression

(Logistic Loss
Function + SGD)
Multinomial Logistic
Regression

(Multinomial Logistic
Loss + SGD)
Linear Regression

(Squared Loss
Function + SGD)
The optimization technique used in Amazon ML is

online Stochastic Gradient Descent (SGD)
<demo>
...
</demo>
Amazon

Machine Learning

(Amazon ML)
Data Model
Batch
Predictions
Real-time
Predictions
What about Deep Learning?
Neural Networks
Perceptron
Layers
Perceptron
https://upload.wikimedia.org/wikipedia/commons/8/8c/Perceptron_moj.png
https://upload.wikimedia.org/wikipedia/commons/thumb/f/f1/Logistic-sigmoid-vs-scaled-probit.svg/240px-Logistic-sigmoid-vs-scaled-probit.svg.png
Neural
Network
Architectures
http://www.asimovinstitute.org/neural-network-zoo/
http://www.asimovinstitute.org/neural-network-zoo/
http://www.asimovinstitute.org/neural-network-zoo/
Deep Scalable Sparse
Tensor Network Engine
(DSSTNE)
Pronounced “Destiny”
An Amazon developed library for building
Deep Learning (DL) Machine Learning (ML) models
https://github.com/amznlabs/amazon-dsstne
O
pen
Source
DSSTNE features for production workloads
Multi-GPU
Scale
Training and prediction both scale out to use
multiple GPUs, spreading out computation
and storage in a model-parallel fashion for
each layer
Large
Layers
Model-parallel scaling enables larger networks
than are possible with a single GPU
Sparse
Data
DSSTNE is optimized for fast performance on
sparse datasets. Custom GPU kernels
perform sparse computation on the GPU,
without lling in lots of zeroes
First DSSTNE Benchmarks
https://medium.com/@scottlegrand/first-dsstne-benchmarks-tldr-almost-15x-faster-than-tensorflow-393dbeb80c0f
Amazon EC2 P2 Instances
Up to:
• 16 NVIDIA K80 GPUs
• 64 vCPUs 732 GiB of host memory
• combined 192 GB of GPU memory
• 40 thousand parallel processing cores
• 70 teraflops (single precision)
• over 23 teraflops (double precision).
• GPUDirect™ for up to 16 GPUs
DSSTNEData Model
Let’s Build a “Smart” Mobile App
Real-time
Predictions
AWS
Lambda
Function(s)
Amazon
Machine Learning
Model
Amazon
Kinesis
Stream
Amazon
Redshift
Database
Amazon S3
Bucket
Amazon
Cognito
Identity
Amazon SNS
Mobile Push
Amazon
Mobile
Analytics
Amazon
Kinesis
Firehose
“Smart”
Mobile
App
AWS
Lambda
Function(s)
Amazon
Machine Learning
Model
Amazon
Kinesis
Stream
Amazon
Redshift
Database
Amazon S3
Bucket
Amazon
Cognito
Identity
Amazon SNS
Mobile Push
Amazon
Mobile
Analytics
Amazon
Kinesis
Firehose
“Smart”
Mobile
App
Where are
the Servers?
Where are
the Servers?
Build Event-Driven
Serverless Apps
And Focus on Your Idea
AWS CLI
AWS SDKs
A
utom
ate
Build Apps With Services,
Not Servers
aws.amazon.com/free
Thank you
@danilop
danilop

Voxxed Days Thesaloniki 2016 - Machine Learning for Developers