Top Banner
Serverless Machine Learning on Amazon Web Services clda.co/awsroma 10/15/2016 AWS @ Rome Applicazioni di Intelligenza Ar:ficiale con AWS Lambda
32

Serverless Machine Learning on AWS - AWS Rome Meetup

Apr 16, 2017

Download

Engineering

Alex Casalboni
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Serverless Machine Learning on AWS - AWS Rome Meetup

Serverless  Machine  Learning  on  Amazon  Web  Services

clda.co/aws-­‐roma10/15/2016 AWS  @  Rome

Applicazioni  di  Intelligenza  Ar:ficiale  con  AWS  Lambda

Page 2: Serverless Machine Learning on AWS - AWS Rome Meetup

@alex_casalboni

clda.co/aws-­‐roma AWS  @  Rome

Web  Developer  (6+  years)

Sr.  SoFware  Engineer  @  Cloud  Academy

Master  in  Computer  Science

About  me

Page 3: Serverless Machine Learning on AWS - AWS Rome Meetup

What  is  Machine  Learning?

Back  to  1959  (Arthur  Samuel)

How  computers  learn  from  Data

How  to  solve  decision  problems

AWS  @  Romeclda.co/aws-­‐roma

Page 4: Serverless Machine Learning on AWS - AWS Rome Meetup

Machine  Learning  pipeline

Training Predic3on

batch real-­‐Cme

Feature  extrac3on

batch

data informa:on

features ML  models

AWS  @  Romeclda.co/aws-­‐roma

Page 5: Serverless Machine Learning on AWS - AWS Rome Meetup

?

Machine  Learning  taxonomy

Supervised    Learning

Unsupervised    Learning

AWS  @  Romeclda.co/aws-­‐roma

Page 6: Serverless Machine Learning on AWS - AWS Rome Meetup

?Machine  Learning  taxonomy

classifica9on

regression 170cm

Supervised    Learning

Unsupervised    Learning

AWS  @  Romeclda.co/aws-­‐roma

Page 7: Serverless Machine Learning on AWS - AWS Rome Meetup

Machine  Learning  taxonomy

Supervised    Learning

Unsupervised    Learning

AWS  @  Romeclda.co/aws-­‐roma

Page 8: Serverless Machine Learning on AWS - AWS Rome Meetup

Machine  Learning  taxonomy

clustering

rule  extrac9on

group A group B

A, B C

Supervised    Learning

Unsupervised    Learning

AWS  @  Romeclda.co/aws-­‐roma

Page 9: Serverless Machine Learning on AWS - AWS Rome Meetup

What  problems  can  ML  solve  for  you?

Supervised    Learning

Unsupervised    Learning

classifica'on

regression

clustering

rule  extrac'on

?

170cm

gro gro

A, B C

AWS  @  Romeclda.co/aws-­‐roma

Page 10: Serverless Machine Learning on AWS - AWS Rome Meetup

What  problems  can  ML  solve  for  you?

Supervised    Learning

Unsupervised    Learning

classifica'on

regression

clustering

rule  extrac'on

?fraud  detec:on

170cm

gro gro

A, B C

price  of  a  stock  over  :me

purchase  likelihood

user  segmenta:on

AWS  @  Romeclda.co/aws-­‐roma

Page 11: Serverless Machine Learning on AWS - AWS Rome Meetup

LearningDataMachine

Cloud

Big

Science

Information

Internet

Statistics

Technology

Python Future

Mining Social

Deep

IOT

AlgorithmsManagement

Storage Petabytes

Parallel

Network

Privacy

MillionNoSQL

PaaS

SQL

Database

Exabytes

Billion

Dataset

Hadoop

R

AWS  @  Romeclda.co/aws-­‐roma

Page 12: Serverless Machine Learning on AWS - AWS Rome Meetup

Generated  data  started  growing  ~10  years  ago…

“90%  of  the  data  in  the  world  today  has  been    created  in  the  last  two  years  alone”  -­‐  IBM

“300+  hours  worth  of  video  content  is  being    uploaded  to  the  site  every  minute”  -­‐  Youtube

AWS  @  Romeclda.co/aws-­‐roma

Page 13: Serverless Machine Learning on AWS - AWS Rome Meetup

…  and  it  keeps  geMng  bigger!

AWS  @  Romeclda.co/aws-­‐roma

Page 14: Serverless Machine Learning on AWS - AWS Rome Meetup

Big  data  challenges

Manual  explora:on  is  not  an  op:on

Data-­‐driven  decisions  are  a  must

Distributed/parallel  compu:ng

The  curse  of  dimensionality

AWS  @  Romeclda.co/aws-­‐roma

Page 15: Serverless Machine Learning on AWS - AWS Rome Meetup

AWS  @  Romeclda.co/aws-­‐roma

Page 16: Serverless Machine Learning on AWS - AWS Rome Meetup

AWS  @  Romeclda.co/aws-­‐roma

Page 17: Serverless Machine Learning on AWS - AWS Rome Meetup

Why  is  deploying  ML  models  a  challenge?

AWS  @  Romeclda.co/aws-­‐roma

Page 18: Serverless Machine Learning on AWS - AWS Rome Meetup

Why  is  deploying  ML  models  a  challenge?

AWS  @  Romeclda.co/aws-­‐roma

+

+

Data  Scien:st

Data

Time

Page 19: Serverless Machine Learning on AWS - AWS Rome Meetup

Why  is  deploying  ML  models  a  challenge?

AWS  @  Romeclda.co/aws-­‐roma

+

+

Data  Scien:st

Data

Time

ML  Model

Data  Visualisa:on

Prototype

+

+

Page 20: Serverless Machine Learning on AWS - AWS Rome Meetup

Why  is  deploying  ML  models  a  challenge?

AWS  @  Romeclda.co/aws-­‐roma

Produc:on  Code

+

+

Data  Scien:st

Data

Time

ML  Model

Data  Visualisa:on

Prototype

+

+

Page 21: Serverless Machine Learning on AWS - AWS Rome Meetup

Why  is  deploying  ML  models  a  challenge?

AWS  @  Romeclda.co/aws-­‐roma

+

+

Data  Scien:st

Data

Time

ML  Model

Data  Visualisa:on

Prototype

+

+

Web  Developer

DevOps

A  lot  of  Time

+

+

Page 22: Serverless Machine Learning on AWS - AWS Rome Meetup

Why  is  deploying  ML  models  a  challenge?

1.  Prototyping  !=  Produc:on-­‐ready

2.  We  need  Elas:city

4.  Mul:-­‐model  architectures

3.  Too  many  nice-­‐to-­‐have  features

5.  Avoid  lack  of  ownership

AWS  @  Romeclda.co/aws-­‐roma

Page 23: Serverless Machine Learning on AWS - AWS Rome Meetup

Machine  Learning  as  a  Service  (MLaaS)

AmazonMachine  Learning

AzureMachine  Learning

GooglePredicCon  API

IMBWatson  AnalyCcs

BigML

AWS  @  Romeclda.co/aws-­‐roma

cloudacademy.com/blog/machine-­‐learning

Page 24: Serverless Machine Learning on AWS - AWS Rome Meetup

Amazon  Machine  Learning

AmazonML

One  of  the  first  MLaaS  solu:ons  (Apr  2015)

It’s  great  for  classifica:on  and  regression  problems

Only  linear  models  (linear  &  logis:c  regression  +  SGD)

No  support  for  advanced  scenarios  yet  

AWS  @  Romeclda.co/aws-­‐roma

Page 26: Serverless Machine Learning on AWS - AWS Rome Meetup

Serverless  compuCng  to  the  rescue!

Transparent  scalability,  elas:city  and  availability

Developer-­‐friendly  maintenance  (versioning  +  aliases)

AWS  Lambda

Event-­‐driven  approach  &  never  pay  for  idle

Microservices  culture

AWS  @  Romeclda.co/aws-­‐roma

Page 27: Serverless Machine Learning on AWS - AWS Rome Meetup

Quick  Example

clda.co/ML-­‐Lambda

AWS  @  Romeclda.co/aws-­‐roma

Page 28: Serverless Machine Learning on AWS - AWS Rome Meetup

AWS  @  Rome

Serverless  ML  @  Cloud  Academy

Mul:-­‐model  architecture

RESTful  interface  for  each  ML  model

1  Lambda  Func:on  for  each  ML  model

S3  +  RDS  for  storage

Periodic  training  (offline)

Real-­‐world  Example

clda.co/aws-­‐roma

Page 29: Serverless Machine Learning on AWS - AWS Rome Meetup

AWS  @  Romeclda.co/aws-­‐roma

Page 30: Serverless Machine Learning on AWS - AWS Rome Meetup

AWS  @  Romeclda.co/aws-­‐roma

Page 31: Serverless Machine Learning on AWS - AWS Rome Meetup

AWS  @  Romeclda.co/aws-­‐roma

AWS  Lambda

No  real-­‐:me  models  (only  pseudo  real-­‐:me)

Deployment  package  management:  size  limit  and  OS  libraries

Not  suitable  for  model  training  yet  (5  min  max  execu:on  :me)

Cold  start  :me  is  long  and  hard  to  avoid

Unit/integra:on  tests  help,  but  not  enough

LimitaCons  of  Serverless  ML

Page 32: Serverless Machine Learning on AWS - AWS Rome Meetup

Grazie  =)

cloudacademy.com

Q  &  A

10/15/2016 AWS  @  Rome