25
1/25 http://www.deeplearning.net/software/theano http://groups.google.com/group/theanoannounce theano

theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

1/25

http://www.deeplearning.net/software/theano

http://groups.google.com/group/theano­announce

theano

Page 2: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

2/25

Theano: A CPU and GPUMath Expression Compiler

James Bergstra, Olivier Breuleux, Frederic Bastien,Pascal Lamblin, Razvan Pascanu, GuillaumeDesjardins, Joseph Turian, Yoshua Bengio

Page 3: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

3/25

numpynumexpr

SymPy

scipy.linalgscipy.weavescipy.signal

pycuda

pyopencl

cythonthreading

multiprocessing

Page 4: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

4/25

>>>

Page 5: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

5/25

Page 6: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

6/25

Page 7: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

7/25

No pow() ??

Page 8: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

8/25

A real example: Logistic Regression­ GPU ­ready­ symbolic differentiation­ speed optimizations­ stability optimizations

Page 9: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

9/25

Page 10: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

10/25

Page 11: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

11/25

Page 12: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

12/25

Page 13: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

13/25

log1p(exp(x))

DGEMV(x.T,<>,0.98,W)

Loop Fusion logistic sigmoid

Page 14: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

14/25

Some Benchmarks­ Multi­layer Perceptron­ Convolutional Neural Network­ Misc. Elementwise

Competitors­ NumPy+SciPy, MATLAB­ EBLearn, Torch5­ numexpr

Page 15: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

15/25

Multi­Layer Perceptron: 60x784 matrix times 784x500matrix, tanh, times 500x10 matrix, elemwise, then all inreverse for backpropagation.

Page 16: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

16/25

Convolutional Network: 256x256 images convolved with6 7x7 filters, downsampling to 6x50x50, tanh,convolution with 16 6x7x7 filters, tanh, matrix multiply,elemwise, then all in reverse for backpropagation.

Page 17: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

17/25

Solid blue: TheanoDashed red: numexpr (without MKL)

Page 18: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

18/25

Theano in Summary• High Level functional description of calculation• Rearranges expressions for speed and stability• Compiles many expressions to machine language• Uses GPU implementations (where possible)

http://www.deeplearning.net/software/theanohttp://groups.google.com/group/theano­announce

Page 19: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

19/25

Theano Sprint

Ideas:­ Get Theano running on your computer­ Get an algorithm running with Theano­ Improve PyCUDA integration?­ Translate to/from SymPy graphs?­ Improve linear algebra support?­ Implement a conjugate solver ?­ Advanced Indexing with gradient ??

Page 20: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

20/25

Page 21: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

21/25

Page 22: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

22/25

Page 23: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

23/25

Page 24: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

24/25

Page 25: theano - SciPyconference.scipy.org/scipy2010/slides/james_bergstra_theano.pdf2/25 Theano:ACPU and GPU Math Expression Compiler James Bergstra, Olivier Breuleux, Frederic Bastien, Pascal

25/25