KERAS/TENSORFLOW François Fayard November 29, 2017 BAYNCORE PARIS
Deep Learning The Mark I Perceptron Machine Cornell Aeronautical Laboratory The perceptron (1957) 2
Classifying points in the plane P = (x 1 , x 2 ) 3
The Perceptron The point P = (x 1 , x 2 ) will be classified as: blue if u ⍺ (x 1 , x 2 ) > 0 • red if u ⍺ (x 1 , x 2 ) < 0 • 4
A Perceptron is a linear classifier P = (x 1 , x 2 ) 5
The loss function for a classifier and a given point For any given point P = (x 1 , x 2 ), we define the loss L( ⍺ , P) by: 6
The loss function for a classifier The loss for a classifier u ⍺ is defined as • We seek for the classifier with the smallest loss • 7
Stochastic Gradient Descent To minimize L: • We start with a random value ⍺ • We compute the gradient of L analytically (backpropagation) using only • a random subset of the images (mini batch) We update ⍺ by • where η is the learning rate We iterate the process until convergence • 8
Introducing Keras Keras is an API specification for building Deep Learning models across • platforms Keras API specification Theano-Keras … TensorFlow-Keras 9
Installing Keras& TensorFlow 10
Installing Kerasis easy with Intel Intel Confidential 11
Training a neural network is easy with Keras Intel Confidential 12
Linear classifiers don’t always do the job P = (x 1 , x 2 ) 13
Hidden LAYERS Our first hidden layer 14
Our first hidden layer 15
The activation function 16
Training a neural network is easy with Keras 17
Deep learning does the job P = (x 1 , x 2 ) 18
MNIST 19
Reading digits from MNIST 20
Deep Learning at Bell Labs: Late 80s Yann Le Cun Director of AI Research Facebook 21
Defining the neural network 22
Defining the neural network 23
The learning phase 24
Benchmarks: Intel TensorFlow 25
The benchmark: AlexNet Won the ImageNet Challenge in 2012. Topology: 5 convolutional layers • 3 fully connected layers • 60 million parameters, 650 000 neurons • 26
Google TensorFlowperformance on AlexNet 400 350 300 Images per second 250 200 150 100 50 0 Original Training - Google Inference - Google 27
Running vTuneon Google TensorFlow 28
Google/Intel TensorFlowperformance on AlexNet 2000 2000 1800 1800 Number of images per second Number of images per second 1600 1600 1400 1400 1200 1200 1000 1000 800 800 600 600 400 400 200 200 0 0 Original Original Training - Google Training - Intel Inference - Google Inference - Intel 29
Running vTuneon Intel TensorFlow 30
Take Home Messages Starting Deep Learning is easy with Keras • Keras is better seen as an API. It can be used with different frameworks. • Use Intel Optimized Python Distribution for better performance • 31
Questions 32
Recommend
More recommend