$30 off During Our Annual Pro Sale. View Details »

Machine Learning for Developers

Machine Learning for Developers

Devoxx Belgium, Antwerp, November 10th, 2016

Have you always wanted to add predictive capabilities or voice recognition to your application, but haven’t been able to find the time or the right technology to get started? Everybody wants to build smart apps, but only a few are Data Scientists. We had the same issue inside Amazon, so we created a Machine Learning engine that Developers can easily use. The same approach is now available in the AWS cloud. And we introduced Amazon Alexa to build engaging voice experiences for your services and devices: if you are a device maker, and your connected product has a microphone and a speaker, the Alexa Voice Service (AVS) enables you to add voice-powered experiences to your connected devices. And you can also use the Alexa Skills Kit (ASK) to teach new skills to Alexa!

Danilo Poccia

November 10, 2016
Tweet

More Decks by Danilo Poccia

Other Decks in Programming

Transcript

  1. Machine Learning
    for Developers
    Danilo Poccia
    Technical Evangelist, AWS
    @danilop
    Sébastien Stormacq
    Solution Architect, Alexa
    @sebsto

    View Slide

  2. What to Expect from this Session
    Understand Machine Learning
    Terminology & Challenges
    Implement a Machine Learning Model
    Add Predictive Capabilities to your App
    Provide Your Customer with Voice UX

    View Slide

  3. 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/

    View Slide

  4. 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

    View Slide

  5. Batch
    Report

    View Slide

  6. Batch
    Report
    Real-time
    Alerts

    View Slide

  7. Batch
    Report
    Real-time
    Alerts
    Prediction
    Forecast

    View Slide

  8. Predictions

    View Slide

  9. Data Predictions

    View Slide

  10. Model
    Data Predictions

    View Slide

  11. Model

    View Slide

  12. Machine Learning

    View Slide

  13. 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

    View Slide

  14. Reinforcement
    Learning
    Perform
    a certain goal in a
    dynamic environment,
    without an explicit
    “teacher”

    View Slide

  15. Driving a vehicle
    Playing a game

    against an opponent
    R
    einforcem
    ent
    Learning

    View Slide

  16. Clustering
    U
    nsupervised

    Learning

    View Slide

  17. Clustering
    U
    nsupervised

    Learning

    View Slide

  18. Clustering
    U
    nsupervised

    Learning

    View Slide

  19. Regression
    Binary Classification
    Multi-class Classification
    Supervised

    Learning

    View Slide

  20. Validation
    Supervised

    Learning

    View Slide

  21. Training from Labeled Data
    Supervised

    Learning
    Training
    Validation
    70%
    30%

    View Slide

  22. Training the Model
    Minimizing the Error Function
    Supervised

    Learning

    View Slide

  23. Be Careful of Overfitting
    Supervised

    Learning

    View Slide

  24. Be Careful of Overfitting
    Supervised

    Learning

    View Slide

  25. Be Careful of Overfitting
    Supervised

    Learning

    View Slide

  26. Better Model,
    Different Predictions
    Supervised

    Learning

    View Slide

  27. Supervised

    Learning
    Better Model,
    Different Predictions

    View Slide

  28. Regularization
    Adding a “cost” for using

    large parameters in the model
    L1, L2
    Supervised

    Learning

    View Slide

  29. ?
    Data Model

    View Slide

  30. Amazon EMR
    with Spark (MLib)
    Data Model

    View Slide

  31. Data Scientists
    “Scalability”

    View Slide

  32. Amazon

    Machine Learning

    (Amazon ML)
    Data Model

    View Slide

  33. Amazon

    Machine Learning

    (Amazon ML)
    Data Model
    Batch
    Predictions

    View Slide

  34. Amazon

    Machine Learning

    (Amazon ML)
    Data Model
    Batch
    Predictions
    Real-time
    Predictions

    View Slide

  35. Binary Classification
    Multiclass
    Classification
    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)

    View Slide


  36. ...

    View Slide


  37. Bike Sharing

    View Slide

  38. View Slide

  39. View Slide

  40. All Users

    View Slide

  41. All Users
    Casual Users
    Registered Users

    View Slide


  42. ...

    View Slide

  43. What about Deep Learning?

    View Slide

  44. Neural Networks
    Perceptron
    Layers

    View Slide

  45. 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

    View Slide

  46. Neural
    Network
    Architectures
    http://www.asimovinstitute.org/neural-network-zoo/

    View Slide

  47. Deep Learning AMI
    5 Deep Learning Frameworks
    MXNet, Caffe, Tensorflow, Theano, and Torch
    Pre-installed components to speed productivity, such
    as Nvidia drivers, cuDNN, Anaconda, Python 2 & 3
    AWS Integration
    R
    eady
    to
    use
    on
    A
    m
    azon
    EC
    2

    View Slide

  48. 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
    G
    PU
    Instances

    View Slide

  49. What about interacting with devices
    in a more intuitive way, using voice?

    View Slide

  50. View Slide


  51. ...

    View Slide

  52. Create Great Content:
    ASK is how you connect

    to your consumer
    THE ALEXA ECOSYSTEM
    Supported by two powerful frameworks
    A L E X A 

    V O I C E 

    S E R V I C E
    Unparalleled Distribution:
    AVS allows your content

    to be everywhere
    Lives In The Cloud
    Automated Speech Recognition
    (ASR)
    Natural Language Understanding
    (NLU)
    Always Learning
    A L E X A 

    S K I L L S 

    K I T

    View Slide

  53. UNDER THE HOOD OF ASK
    A closer look at how the Alexa Skills Kit process a request and returns an appropriate
    response
    You Pass Back a Textual
    or Audio Response
    You Pass Back a Graphical Response
    Alexa Converts Text-to-Speech (TTS) &
    Renders Graphical Component
    Respond to Intent
    through Text & Visual
    Alexa sends Customer
    Intent to Your Service
    User Makes
    a Request Alexa Identifies Skill & Recognizes
    Intent Through ASR & NLU
    Your Service
    processes
    Request
    Audio Stream is
    sent up to Alexa

    View Slide

  54. ALEXA SKILL KIT
    High Level Overview
    Your Code

    View Slide

  55. ALEXA SKILL KIT
    High Level Overview
    Amazon EC2

    View Slide

  56. ALEXA SKILL KIT
    High Level Overview
    Availability Zone 1
    Web tier
    App tier
    RDS
    (Master)
    Availability Zone 2 RDS
    (Standby)

    View Slide

  57. ALEXA SKILL KIT
    High Level Overview
    Elastic Beanstalk environment
    Auto Scaling group
    Elastic Beanstalk container
    Auto Scaling group
    Elastic Beanstalk container
    Prod 1
    Prod 2
    Route 53

    View Slide

  58. ALEXA SKILL KIT
    High Level Overview
    AWS Lambda

    View Slide

  59. ALEXA SKILL KIT
    Voice Model
    Intents
    Utterances
    Slots

    View Slide

  60. ALEXA SKILL KIT
    Voice Model
    Intents
    Utterances
    Slots

    View Slide

  61. ALEXA SKILL KIT
    Voice Model
    Intents
    Utterances
    Slots

    View Slide

  62. ALEXA SKILL KIT
    Voice Model
    Intents
    Utterances
    Slots

    View Slide

  63. ALEXA SKILL KIT
    Typescript Code

    View Slide

  64. ALEXA SKILL KIT
    Alexa App

    View Slide


  65. ...

    View Slide

  66. Your Skill
    (Lambda function)
    Amazon
    Machine Learning
    get real-time predictions
    invoke
    Weather
    Forecast
    Historical Data
    get forecast
    build & train model
    B
    ike
    Sharing
    D
    em
    o
    A
    rchitecture

    View Slide

  67. Build Apps With Services,
    Not Servers

    View Slide

  68. aws.amazon.com/free
    developers.amazon.com

    View Slide

  69. Thank you!
    @danilop @sebsto

    View Slide