Getting Started With Theano
Getting Started With Theano
2
What is Theano?
A mathematical symbolic expression compiler
A Python library for symbolic maths - far broader than just Deep Learning
Tightly integrated with the Python ecosystem
3
What is Theano?
Symbolic expression compiler
Variables and expressions are symbolic - more like maths than code
4
What is Theano?
Additional features
5
What is Theano?
Theano defines a language, a compiler and a library
Compile a function that can compute numeric values using those expressions
Execute that function on data
6
y =ab
Example Theano application
a, b 2 R
7
y =ab
Example Theano application
a, b 2 R
8
y =ab
Example Theano application
a, b 2 R
9
y =ab
Example Theano application
a, b 2 R
Compile a function
10
y =ab
Example Theano application
a, b 2 R
Compile a function
11
Theano for deep learning
Highly expressive
Symbolic differentiation
Transparent GPU acceleration
Easily integrates with Python ecosystem
12
Theano for deep learning
Symbolic computation for tensors
y1 y2
y1 = (w11 x1 + w21 x2 + w31 x3 )
y2 = (w12 x1 + w22 x2 + w32 x3 )
w11 w12 w31 w33
=)
w21 w22
x1 x2 x3 y = (W x)
13
Theano for deep learning
Highly expressive: easily add new activation or loss functions
14
The update is a function of
Theano for deep learning partial derivative of error w.r.t
parameters
Symbolic differentiation
15
Example: Linear model
16
Example credit: Introduction to Deep Learning with Python, Alec Radford, https://www.youtube.com/watch?v=S75EdAcXHKk
Example: Linear model
Initialize symbolic variables
17
Example credit: Introduction to Deep Learning with Python, Alec Radford, https://www.youtube.com/watch?v=S75EdAcXHKk
Example: Linear model
Initialize symbolic variables
18
Example credit: Introduction to Deep Learning with Python, Alec Radford, https://www.youtube.com/watch?v=S75EdAcXHKk
Example: Linear model
Initialize symbolic variables
19
Example credit: Introduction to Deep Learning with Python, Alec Radford, https://www.youtube.com/watch?v=S75EdAcXHKk
Example: Linear model
Initialize symbolic variables
20
Example credit: Introduction to Deep Learning with Python, Alec Radford, https://www.youtube.com/watch?v=S75EdAcXHKk
Example: Linear model
Initialize symbolic variables
21
Example credit: Introduction to Deep Learning with Python, Alec Radford, https://www.youtube.com/watch?v=S75EdAcXHKk
Example: Linear model
Initialize symbolic variables
22
Example credit: Introduction to Deep Learning with Python, Alec Radford, https://www.youtube.com/watch?v=S75EdAcXHKk
Example: Linear model
Initialize symbolic variables
23
Example credit: Introduction to Deep Learning with Python, Alec Radford, https://www.youtube.com/watch?v=S75EdAcXHKk
Example: Linear model
Initialize symbolic variables
24
Example credit: Introduction to Deep Learning with Python, Alec Radford, https://www.youtube.com/watch?v=S75EdAcXHKk
Example: Linear model
25
Designing more complex architectures
26
Designing more complex architectures
27
Related projects
Built on top of Theano (mostly machine learning)
Blocks
Keras
Lasagne
Morb Typically simplify syntax and interface for artificial
neural network training at the expense of
Pylearn2
expressiveness
PyMC 3
sklearn-theano
theano-rnn
more
28
Related projects
CNN example in Keras
29
Example applications
Music recommendation at Spotify
http://benanne.github.io/2014/08/05/spotify-cnns.html
30
Example applications
Classifying galaxies and plankton and winning Kaggle contests
http://benanne.github.io/2014/04/05/galaxy-zoo.html
http://benanne.github.io/2015/03/17/plankton.html
31
Example applications
32
Installation
Linux, OS X or Windows
Requirements:
33
Installation
Basic instructions:
pip install Theano
easy_install Theano
34
Configuration
35
GPU acceleration
36
Deep Learning Lab Series Schedule
developer.nvidia.com/deep-learning-courses
Review the other seminars in series
37
Hands-on Lab
38