© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Gabe Hollombe, Sr. Technical Evangelist
@gabehollombe
A Gentle Intro to Deep Learning
Or, “I can Deep Learning and So Can You”
February 2019
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Gabe Hollombe
Software Developer & Technical Evangelist,
Amazon Web Services
15+ years writing all sorts of software
EdTech ⇢ Agile/XP Consulting ⇢ Nano-satellites ⇢ AWS
Web / JS / Ruby / Python / Clojure / C#
Bad puns, fresh sushi, old whiskey
@gabehollombe
!
"
❤
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What we’ll cover
1. Kick off a demo (put the cookies in the oven)
2. What’s Deep Learning? What’s a Neural Network?
3. Look at some code
4. Finish the demo (enjoy our cookies)
5. How to do this yourself
6. Where to learn more
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What is Deep Learning?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Machine Learning
A technique to help computers learn
how to do things that are easy for humans
(but hard to explicitly program).
Self-driving Cars Sentiment Analysis Object Detection Facial Recognition
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Machine Learning
Using neural networks with multiple layers,
which allows computers to learn from
complex data without needing to explicitly
define the features of the data.
Neural Networks
Deep Learning
Computation inspired by how our brains
work. Proven to be capable of performing
any computation, given enough memory.
Computers figuring out how to do things
without being explicitly programmed.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
You don’t need a PHD.
You don’t need a ton of data.
You can start using deep learning
for your own projects today.
Without a dedicated data science
team of experts.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
{ "Labels": [
{ "Name": "Skateboard", "Confidence": 99.25341796875 },
{ "Name": "Sport", "Confidence": 99.25341796875 },
{ "Name": "Sports", "Confidence": 99.25341796875 },
{ "Name": "Human", "Confidence": 99.24723052978516 },
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
We can build and deploy
a custom image classifier.
Right now.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
First, let’s collect some images
of things we want to classify…
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Put something in the oven
• Understand the concepts
• Read the recipe
• Check in on the baking
• Taste test
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
What is a Neural Network?
By Egm4313.s12 (Prof. Loc Vu-Quoc) - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=72816083
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Node with a value
Neural Network recap
linked to other nodes with various
connection strengths.
Each node value is based on how much of
each connecting node’s signal arrives into
it, plus some other value to decide what
the final value will be.
“Neuron”
“Weights”
“Bias”
2
3
1
5
-4
(1 * 2) + (5 * 3) + -4 = 13
13
Example – Two inputs into a neuron
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
How does a Neural Network learn?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Keep trying random connection
strengths between all of the
neurons until we find a combo
that works?
No!
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
0. Randomly initialize the weights and biases (only once at the start).
1. Send each training example through the network, look at the output nodes, and
measure the difference between what you wanted to see versus what you actually
got.
2. Go backwards through the network, adjust the weights and biases by tiny
amounts, trying to nudge the output values closer to what you want to see.
3. Repeat until the network performs well for all of your examples.
4. Run some validation examples through the network to make sure it works for
new data, too.
Training recap
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Image Classification trick: examine neighboring pixels together
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Image Kernels
Explained Visually
http://setosa.io/ev/image-kernels/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Layer 1
Contrasts
& Similarity
Layer 2
Lines, Circles, Gradients
Layer 3
Patterns, Text, Human Shapes
Layer 5
Dog heads,
Bike wheels,
Animal eyes,
Flower centers
. . .
via https://arxiv.org/abs/1311.2901
Visualizing and Understanding Convolutional Networks
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Making A Custom Image Classifier
In 21 Lines of Code
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
FRAMEWORKS AND INTERFACES
ML for data scientists
KERAS
Frameworks Inter faces
APPLICATION SERVICES
ML for everyone
PLATFORM SERVICES
ML for engineers
NVIDIA
Tesla V100 GPUs
(14x faster than P2)
Machine Learning
AMIs
INFRASTRUCTURE
Powering the ML
Intel Xeon
Skylake
(Optimized for ML)
AWS
GREENGRASS ML
L E X P O L L Y R E K O G N I T I O N
I M A G E & V I D E O
T R A N S C R I B E T R A N S L A T E C O M P R E H E N D F O R E C A S T P E R S O N A L I Z E
AMAZON
SAGEMAKER
AWS
DEEPLENS
SAGEMAKER
GROUND TRUTH &
MECHANICAL TURK
SPARK
& EMR
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon SageMaker
Build Train Deploy
• Managed notebooks for authoring models
• Templates for common ML applications
• Built-in, high performance algorithms
• Broad framework support
• One-click training
• Automatic model tuning
• One-click deployment
• Automatic A/B testing
• Fully-managed hosting with auto scaling
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
This is what we ran
in the Jupyter Notebook
on AWS
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Let’s try out our image classifier!
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
More ML is built on AWS than anywhere else
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Detecting the best images to use
• Expedia have over 10 million images
from 300,000 hotels
• Using great images boosts conversion
• They fine-tuned a pre-trained
Convolutional Neural Network using
100,000 images
• Hotel descriptions now automatically
feature the best available images https://news.developer.nvidia.com/expedia-ranking-hotel-images-
with-deep-learning/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Improving written text
with Amazon SageMaker
“Amazon SageMaker makes it possible for us
to develop our TensorFlow models in a
distributed training environment. (…)
We can run inference on SageMaker itself, or if
we need just the model, we download it from
S3 and run inference of our mobile device
implementations for iOS and Android
customers.”
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Where can I learn more?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Great places to get started with Deep Learning
3Blue1Brown’s YouTube series on Neural Networks ~ 60 Minutes
https://www.youtube.com/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi
Fast.ai’s Practical Deep Learning for Coders ~ 14 Hours
http://www.fast.ai/
Neural Networks and Deep Learning, by Michael Neilsen ~ 6 Chapter Book
http://neuralnetworksanddeeplearning.com/
Amazon SageMaker - Fully-managed Platform
https://aws.amazon.com/sagemaker/
These Demos - Jupyter Notebooks & Web Apps
https://github.com/gabehollombe-aws/jupyter-notebooks
https://github.com/gabehollombe-aws/webcam-s3-uploader
https://github.com/gabehollombe-aws/webcam-sagemaker-inference
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Machine Learning is for Everyone.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
What will you build?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Thank you!
Please keep in touch:
! @gabehollombe
✉ gabehol@amazon.com

A Gentle Intro to Deep Learning

  • 1.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Gabe Hollombe, Sr. Technical Evangelist @gabehollombe A Gentle Intro to Deep Learning Or, “I can Deep Learning and So Can You” February 2019
  • 2.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Gabe Hollombe Software Developer & Technical Evangelist, Amazon Web Services 15+ years writing all sorts of software EdTech ⇢ Agile/XP Consulting ⇢ Nano-satellites ⇢ AWS Web / JS / Ruby / Python / Clojure / C# Bad puns, fresh sushi, old whiskey @gabehollombe ! " ❤
  • 3.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. What we’ll cover 1. Kick off a demo (put the cookies in the oven) 2. What’s Deep Learning? What’s a Neural Network? 3. Look at some code 4. Finish the demo (enjoy our cookies) 5. How to do this yourself 6. Where to learn more
  • 4.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. What is Deep Learning?
  • 5.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Machine Learning A technique to help computers learn how to do things that are easy for humans (but hard to explicitly program). Self-driving Cars Sentiment Analysis Object Detection Facial Recognition
  • 6.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Machine Learning Using neural networks with multiple layers, which allows computers to learn from complex data without needing to explicitly define the features of the data. Neural Networks Deep Learning Computation inspired by how our brains work. Proven to be capable of performing any computation, given enough memory. Computers figuring out how to do things without being explicitly programmed.
  • 7.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark You don’t need a PHD. You don’t need a ton of data. You can start using deep learning for your own projects today. Without a dedicated data science team of experts.
  • 8.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. { "Labels": [ { "Name": "Skateboard", "Confidence": 99.25341796875 }, { "Name": "Sport", "Confidence": 99.25341796875 }, { "Name": "Sports", "Confidence": 99.25341796875 }, { "Name": "Human", "Confidence": 99.24723052978516 },
  • 9.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. We can build and deploy a custom image classifier. Right now.
  • 10.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. First, let’s collect some images of things we want to classify…
  • 11.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. • Put something in the oven • Understand the concepts • Read the recipe • Check in on the baking • Taste test
  • 12.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What is a Neural Network? By Egm4313.s12 (Prof. Loc Vu-Quoc) - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=72816083
  • 13.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.
  • 14.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Node with a value Neural Network recap linked to other nodes with various connection strengths. Each node value is based on how much of each connecting node’s signal arrives into it, plus some other value to decide what the final value will be. “Neuron” “Weights” “Bias” 2 3 1 5 -4 (1 * 2) + (5 * 3) + -4 = 13 13 Example – Two inputs into a neuron
  • 15.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark How does a Neural Network learn?
  • 16.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Keep trying random connection strengths between all of the neurons until we find a combo that works? No!
  • 17.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.
  • 18.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 0. Randomly initialize the weights and biases (only once at the start). 1. Send each training example through the network, look at the output nodes, and measure the difference between what you wanted to see versus what you actually got. 2. Go backwards through the network, adjust the weights and biases by tiny amounts, trying to nudge the output values closer to what you want to see. 3. Repeat until the network performs well for all of your examples. 4. Run some validation examples through the network to make sure it works for new data, too. Training recap
  • 19.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Image Classification trick: examine neighboring pixels together
  • 20.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Image Kernels Explained Visually http://setosa.io/ev/image-kernels/
  • 21.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Layer 1 Contrasts & Similarity Layer 2 Lines, Circles, Gradients Layer 3 Patterns, Text, Human Shapes Layer 5 Dog heads, Bike wheels, Animal eyes, Flower centers . . . via https://arxiv.org/abs/1311.2901 Visualizing and Understanding Convolutional Networks
  • 22.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Making A Custom Image Classifier In 21 Lines of Code
  • 23.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. FRAMEWORKS AND INTERFACES ML for data scientists KERAS Frameworks Inter faces APPLICATION SERVICES ML for everyone PLATFORM SERVICES ML for engineers NVIDIA Tesla V100 GPUs (14x faster than P2) Machine Learning AMIs INFRASTRUCTURE Powering the ML Intel Xeon Skylake (Optimized for ML) AWS GREENGRASS ML L E X P O L L Y R E K O G N I T I O N I M A G E & V I D E O T R A N S C R I B E T R A N S L A T E C O M P R E H E N D F O R E C A S T P E R S O N A L I Z E AMAZON SAGEMAKER AWS DEEPLENS SAGEMAKER GROUND TRUTH & MECHANICAL TURK SPARK & EMR
  • 24.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Amazon SageMaker Build Train Deploy • Managed notebooks for authoring models • Templates for common ML applications • Built-in, high performance algorithms • Broad framework support • One-click training • Automatic model tuning • One-click deployment • Automatic A/B testing • Fully-managed hosting with auto scaling
  • 25.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. This is what we ran in the Jupyter Notebook on AWS
  • 26.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Let’s try out our image classifier!
  • 27.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. More ML is built on AWS than anywhere else
  • 28.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Detecting the best images to use • Expedia have over 10 million images from 300,000 hotels • Using great images boosts conversion • They fine-tuned a pre-trained Convolutional Neural Network using 100,000 images • Hotel descriptions now automatically feature the best available images https://news.developer.nvidia.com/expedia-ranking-hotel-images- with-deep-learning/
  • 29.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Improving written text with Amazon SageMaker “Amazon SageMaker makes it possible for us to develop our TensorFlow models in a distributed training environment. (…) We can run inference on SageMaker itself, or if we need just the model, we download it from S3 and run inference of our mobile device implementations for iOS and Android customers.”
  • 30.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Where can I learn more?
  • 31.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Great places to get started with Deep Learning 3Blue1Brown’s YouTube series on Neural Networks ~ 60 Minutes https://www.youtube.com/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi Fast.ai’s Practical Deep Learning for Coders ~ 14 Hours http://www.fast.ai/ Neural Networks and Deep Learning, by Michael Neilsen ~ 6 Chapter Book http://neuralnetworksanddeeplearning.com/ Amazon SageMaker - Fully-managed Platform https://aws.amazon.com/sagemaker/ These Demos - Jupyter Notebooks & Web Apps https://github.com/gabehollombe-aws/jupyter-notebooks https://github.com/gabehollombe-aws/webcam-s3-uploader https://github.com/gabehollombe-aws/webcam-sagemaker-inference
  • 32.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Machine Learning is for Everyone.
  • 33.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What will you build?
  • 34.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Thank you! Please keep in touch: ! @gabehollombe ✉ gabehol@amazon.com