Slide 1

Slide 1 text

Docker and Deep Learning

Slide 2

Slide 2 text

Summary What is Docker? What is Deep Learning? How can I use Deep Learning today?

Slide 3

Slide 3 text

Outline ● What is Docker? ○ run code in containers ○ isolated virtual environment ○ automate setup for repeatability ● What is Deep Learning? ○ example functions and applications ● How does Deep Learning work? ○ take in lots of example input - output pairs ○ learn a function, there are many techniques ● How can I use Deep Learning today? ○ Demo

Slide 4

Slide 4 text

What is Docker?

Slide 5

Slide 5 text

In their own words

Slide 6

Slide 6 text

Docker containers are Linux in a box

Slide 7

Slide 7 text

Why? Example: Run lots of identical web servers

Slide 8

Slide 8 text

Why? Example: Run lots of machine learning

Slide 9

Slide 9 text

Why? Example: Run research code locally then run the same thing on Google Cloud Engine

Slide 10

Slide 10 text

The applications in the box are up to you

Slide 11

Slide 11 text

How? Containers use host server resources Docker runs application code inside containers The Docker daemon (within the illustrated Container Engine) controls how containers can access resources of the host like disk to store programs or data and CPU to execute code

Slide 12

Slide 12 text

How? Resource Isolation Think of a container like a box inside of which you can run any flavor of the Linux operating system The Docker daemon controls access to host resources like restricting how containers can access networking functions to send and receive traffic Namespaces prevent process interference

Slide 13

Slide 13 text

Vagrant vs Docker

Slide 14

Slide 14 text

Docker saves space

Slide 15

Slide 15 text

Docker saves time* Compared to virtual machines, containers ● startup faster ● use only resources needed at that time ● support direct hardware access *Overall performance depends on the application

Slide 16

Slide 16 text

Docker saves you time Building a Docker container that you can run anywhere saves you time setting up servers Using one that someone on your team (or out on the world wide web) already built and published can save you a lot of time and effort

Slide 17

Slide 17 text

First make a Dockerfile Specify a base image like your favorite Linux OS Write & install code then build the container and next run the application That makes one Dockerfile which describes how to run some application(s) in a container

Slide 18

Slide 18 text

Test and publish your container You can run containers on your own laptop after installing the Docker Engine for your OS Then push it to a registry Later pull the container image file down to any host server running Docker to run anywhere

Slide 19

Slide 19 text

Make a docker-compose file Write a docker-compose file which can pick multiple containers to run on one host server For example we can start up an in-memory network cache as well as a web server

Slide 20

Slide 20 text

Make a Docker Swarm service Write a Docker Swarm service which can run containers automatically on many Docker host servers provisioned using Docker Machine For example we can deploy a web server application to many server nodes in some cloud

Slide 21

Slide 21 text

Reuse setup to run on the cloud

Slide 22

Slide 22 text

What gets run on Docker?

Slide 23

Slide 23 text

What is Deep Learning?

Slide 24

Slide 24 text

What is Deep Learning?

Slide 25

Slide 25 text

Deep Neural Network Training and Inference

Slide 26

Slide 26 text

Example Function : Digit Classification a training dataset with lots of labeled examples presented individually handwritten digits to integers 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

Slide 27

Slide 27 text

Train Handwritten Digit Classification Model

Slide 28

Slide 28 text

Digit Classification Model Inference given new input, infer what digit we are seeing image of digit to predicted integer 3

Slide 29

Slide 29 text

What else can Deep Learning do? ○ Object Recognition ○ Image Captioning ○ Obstacle Detection ○ Speech Recognition ○ Scene Recognition ○ Reinforcement Learning ○ … etc.

Slide 30

Slide 30 text

Example Function: Object Recognition image pixels to semantic object labels and bounding boxes

Slide 31

Slide 31 text

Example Function: Image Captioning image pixels to semantic object labels bounding boxes and image caption

Slide 32

Slide 32 text

Example: Obstacle Detection Online learning to iteratively refine the function model NVidia Jetson TK1 GPU on a drone

Slide 33

Slide 33 text

Example: Speech Recognition mic recorded sound to words The training examples should be in the same language, otherwise there might not be a good match This is a fine day today.

Slide 34

Slide 34 text

Example: Scene Segmentation Fidler et al. Scene Tutorial Reconstruction, Localization, Semantics in RGB-D CVPR'15 Depth camera video data stream to segmented 3D map

Slide 35

Slide 35 text

Example: Coordinated Reinforcement Learning RL sharing knowledge between many learning systems to grasp and pick up objects Behaviors that successfully pick up objects are rewarded and performed more often, this is positive reinforcement Levine et al. Learning Hand-Eye Coordination for Robotic Grasping with Deep Learning and Large-Scale Data Collection 2016

Slide 36

Slide 36 text

Example: Learning Robot Motion Strategy Motor dynamics are known, robot learns movements to pick up and move objects Wong and Takahashi et al. Self-Supervised Deep Visuomotor Learning from Motor Unit Feedback 2016

Slide 37

Slide 37 text

Example: AlphaGo Training policy network suggests the best next move trained on a large history of games value network predicts probability of winning given some position, trained similarly

Slide 38

Slide 38 text

Example: AlphaGo Inference trained networks are used to search tree of possible futures for the game

Slide 39

Slide 39 text

How does Deep Learning work?

Slide 40

Slide 40 text

Training a function from input data

Slide 41

Slide 41 text

Supervised Training with Backpropagation 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0 1 1 1 1 1 2 1 7 1 1 1 1 1 1 ...

Slide 42

Slide 42 text

Supervised Training Sees a Misclassification 2 ≠ 1

Slide 43

Slide 43 text

Supervised Training Corrected Prediction 1 = 1

Slide 44

Slide 44 text

Deep Learning likes matrices Wu et al. Enabling Ubiquitous Visual Intelligence Through Deep Learning Baidu 2015

Slide 45

Slide 45 text

Deep Learning does not like the unexpected

Slide 46

Slide 46 text

Training takes a lot of input data

Slide 47

Slide 47 text

Training produces a model - large and slow

Slide 48

Slide 48 text

Training and Inference

Slide 49

Slide 49 text

Evaluate learned model to perform inference

Slide 50

Slide 50 text

Inference might require lots of hardware NVidia Titan X graphics card

Slide 51

Slide 51 text

Inference might be lightweight Compressed models can preserve accuracy and run on mobile platforms NVidia Jetson TK1 GPU on a drone

Slide 52

Slide 52 text

How can I use Deep Learning today?

Slide 53

Slide 53 text

How can we get started? For supervised learning such as classification and object detection ○ Pick a framework ○ Utilize pre-trained models -or- ○ Record/download data to train our own models ○ Make evaluations of the model on new data

Slide 54

Slide 54 text

Popular frameworks ● Tensorflow ● Caffe ● Theano ● Torch ● MXNet ● Matlab Deep Learning ● and more

Slide 55

Slide 55 text

Download pre-trained network models

Slide 56

Slide 56 text

Or train your own rental GPU instances This will be in the demo

Slide 57

Slide 57 text

Summary What is Docker? ● virtualized containers for isolated and repeatable code execution What is Deep Learning? ● deep neural network function approximation driven by big data How can I use Deep Learning today? ● demo time

Slide 58

Slide 58 text

Thanks

Slide 59

Slide 59 text

Special Thanks Cornell Center for Advanced Computing Adrian Sampson and the Cornell Computer Systems Lab Reading Group for Deep Learning Hardware Song Han from Stanford University

Slide 60

Slide 60 text

References ● Docker Overview ● Edureka What is Docker ● Vagrant Vs Docker by Jonathan Chase ● Docker vs VMs Christopher Tozzi ● https://stanford.edu/~songhan/ ● https://www.dropbox.com/s/p7lvelt0aihrwtl/FPGA%2717%20tutorial%20Song%20Han.pdf?dl=0 ● https://arxiv.org/abs/1602.07360 ● https://www.slideshare.net/embeddedvision/enabling-ubiquitous-visual-intelligence-through-deep-le arning-a-keynote-presentation-from-baidu ● Fidler et al. Scene Tutorial Reconstruction, Localization, Semantics in RGB-D CVPR'15 ● A 'Brief' History of Game AI Up To AlphaGo, Andrey Kurenkov ● Zhang et al Efficient and Accurate Approximations of Nonlinear Convolutional Networks CVPR’15 ● http://www.neurala.com

Slide 61

Slide 61 text

References cont. ● https://www.slideshare.net/xavigiro/deep-learning-for-computer-vision-imagenet-challenge-upc-2016 ● https://pdollar.wordpress.com/2015/01/21/image-captioning/ ● https://github.com/BVLC/caffe/wiki/Model-Zoo ● https://github.com/tensorflow/models ● http://deeplearning.net/tutorial/gettingstarted.html ● http://deeplearning.net/tutorial/gettingstarted.html#early-stopping ● https://arxiv.org/abs/1603.02199 ● https://arxiv.org/abs/1501.02530 ● https://en.wikipedia.org/wiki/Backpropagation ● Goodfellow et al. 2016 http://www.deeplearningbook.org/ ● Where's the Bear Elias et al. https://www.cs.ucsb.edu/sites/cs.ucsb.edu/files/docs/reports/tr.pdf

Slide 62

Slide 62 text

Image and Figure References Testing Docker for Mac by Dave Kerr Edureka What is Docker InfoWorld Containers 101 Swarm Goes Stable by Docker Inc Docker community ecosystem Docker Compose Example by Racquel Pau Continuous Delivery with Docker by Julia Mateo See Song Han FPGA '17 Tutorial in References above See listed References for selected figures ImageNet Wikimedia Commons Flickr ResearchGate Zhang et al. ResearchGate Abedini et al. Nextxen Jetsonhacks Robohub VGG in Tensorflow by Davi Frossard RSIP Vision

Slide 63

Slide 63 text

Author Bennett Wineholt Center for Advanced Computing Cornell University Scientific Software Club at Cornell 04/17/2017

Slide 64

Slide 64 text

Demo Time