In preparation for the lecture given on Thursday, January 15, 2015, those who would like to follow along should install Theano on their machine. Complete installation instructions can be found on Theano’s online documentation.
We will cover how to install Theano on a machine which already meets the requirements. For information on how to install prerequisites, refer to your platform-specific documentation.
Because we intend to install Pylearn2 later on, we will be performing a bleeding-edge installation for the Github repository.
- Linux, Mac OS X or Windows operating system (Note that Linux is the most tested platform.)
- Python 2.x >= 2.6 (The development package (python-dev or python-devel on most Linux distributions) is recommended.)
- g++, python-dev (Not technically required but highly recommended, in order to compile generated C code. Theano can fall back on a NumPy-based Python execution model, but a C compiler allows for vastly faster execution. g++ >= 4.2 (for openmp that is currently always used) more recent version recommended!)
- setuptools or distribute
- numpy >= 1.5.0 (Earlier versions could work, but we don’t test it.)
- scipy (Only currently required for sparse matrix and special functions support, but highly recommended. We recommend SciPy >=0.8 if you are using sparse matrices)
- A BLAS installation with Level 3 functionality (Including the development headers (-dev, -devel, depending on your Linux distribution).) N.B.: OSX users already have a BLAS installation through the Accelerate framework.
These instructions will work on a Linux or Mac OS machine when typed in a bash shell. You may need to adapt the commands to your environment.
- Change directory to where you’d like the Theano codebase to reside (e.g. in your home directory, or in some place where you usually put your code).
git clone git://github.com/Theano/Theano.git
- Change directory inside the Theano directory and type
python setup.py develop --user
This will ensure that the Theano repository you just checked out will be found by the Python interpreter. Every change in the Theano repository is now automatically present when you import the theano module without you needing to reinstall anything. The command “installs” Theano locally; if you’d prefer to have a global installation, remove the –user flag (some sudo’ing legwork may be required in that case).
- To confirm that everything works fine, make sure you’re outside of the Theano directory, launch a Python interpreter and type
If you see no error, the installation was successful!
Keeping things up to date
Theano is regularly updated. In order to get the latest changes, simply run
git pull origin master
inside the Theano directory.