Theano: let’s build a netEkaterina Tuzova
View Slide
Motivation
MNIST datasetX — images (60000, 784)Y — labels (60000, )Goal: train a model to look at images andpredict what digits they are.
K nearest neighbors
K nearest neighbors~95 % accuracy
Feature engineering
Machine Learning
Variable in Computer ScienceA piece of informations stored somewhere in memory with a name made up by aprogrammer.
Variable in MathematicsIndeterminate quantity that can be manipulated using arithmetic operations, or usingcalculus and so on.
Theano
What is Theano?A library for efficiently handling mathematical expressionsinvolving tensors.
What is tensor?Multi-dimensional array.
What is Theano?A mathematical symbolic expression compiler.
Quick How-To- Define symbolic expression- Compile a function that can compute numeric values using those expressions- Execute that function on data
Example modelGoogLeNet, 2014~99.6% accuracy
Logistic regressionProbabilistic, linear classifier.
Simple model
Preparation
Load MNIST
Define model
Theano shared variableShared between different functions and function calls.
Build model
Train model
Train model~93% accuracy
Improve model
Train model~98.5% accuracy
Thank you.@ktisha