29
Theano tutorial part 1 AACIMP 2015 Sergii Gavrylov

(Kpi summer school 2015) theano tutorial part1

Embed Size (px)

Citation preview

Page 1: (Kpi summer school 2015) theano tutorial part1

Theano tutorialpart 1

AACIMP 2015Sergii Gavrylov

Page 2: (Kpi summer school 2015) theano tutorial part1

Overview● Introduction

● Symbolic variables

● Functions

● Shared variables / updates

● Gradients

● Substitution

● Random streams

Page 3: (Kpi summer school 2015) theano tutorial part1

What is Theano?

● Python library

● Computer algebra system

● Compiler

Page 4: (Kpi summer school 2015) theano tutorial part1

Where to find more info?

● Website: deeplearning.net/software/theano

● User mailing list: groups.google.com/group/theano-users

● Deep learning tutorials: deeplearning.net/tutorial

Page 5: (Kpi summer school 2015) theano tutorial part1

Tutorial environment

1. Go to XX.XX.XXX.XXX:XXXX to determine your workspace

id that you will use through this tutorial

2. Go to XX.XX.XXX.XXX:XXXX to use your workspace

3. password: xxxxxxxxx

https://github.com/sergii-gavrylov/theano-tutorial-AACIMP2015

Page 6: (Kpi summer school 2015) theano tutorial part1

Scalar math

Page 7: (Kpi summer school 2015) theano tutorial part1

Symbolic variablesX

+

Z

Y

Page 8: (Kpi summer school 2015) theano tutorial part1

Symbolic variablesX

+

Z

Y

compilation add_fun(_ , _)

37, 5

42

Page 9: (Kpi summer school 2015) theano tutorial part1

Task scalars

Page 10: (Kpi summer school 2015) theano tutorial part1

Data types

Page 11: (Kpi summer school 2015) theano tutorial part1

Data types

Page 12: (Kpi summer school 2015) theano tutorial part1

Vector math

Page 13: (Kpi summer school 2015) theano tutorial part1

Matrix math

Page 14: (Kpi summer school 2015) theano tutorial part1

Task vectors_matrices

Page 15: (Kpi summer school 2015) theano tutorial part1

Shared variables

X

+

Z

Y

42

Page 16: (Kpi summer school 2015) theano tutorial part1

Shared variables

X

+

Z

Y

42

compilation add_fun(_)

1

43

Page 17: (Kpi summer school 2015) theano tutorial part1

Shared variables

Page 18: (Kpi summer school 2015) theano tutorial part1

Updates

Page 19: (Kpi summer school 2015) theano tutorial part1

Task shared_updates

Page 20: (Kpi summer school 2015) theano tutorial part1

Symbolic differentiation

Page 21: (Kpi summer school 2015) theano tutorial part1

Task grad

Page 22: (Kpi summer school 2015) theano tutorial part1
Page 23: (Kpi summer school 2015) theano tutorial part1

Task logistic_regression

Page 24: (Kpi summer school 2015) theano tutorial part1

Substitution

Page 25: (Kpi summer school 2015) theano tutorial part1

Substitution

Page 26: (Kpi summer school 2015) theano tutorial part1

Task substitution

Page 27: (Kpi summer school 2015) theano tutorial part1

Random streams

Page 28: (Kpi summer school 2015) theano tutorial part1

Task random_stream

Page 29: (Kpi summer school 2015) theano tutorial part1

Conclusion● Theano is a tool that combines the best of both worlds: it is easy

to code and fast to execute!

● It is used in both academia and industry.

● Symbolic paradigm is extremely flexible, but it might be not

suitable for everyone.

● Part 2 is coming.