Theano is an open-source Python library that uses a GPU to perform data-intensive computations. The platform combines different aspects of a computer algebra system (CAS) with an optimizing compiler.

It generates customized C programs for mathematical operations. Because of this combination, Theano is very useful in solving complex mathematical expressions repetitively fairly quickly. At present, Theano has plenty of activity on Stackflow.

Project Background

  • Library: Theano
  • Author: Montreal Institute for Learning Algorithms (MILA), University of Montreal
  • Initial Release: 2007
  • Type: Library for machine learning
  • License: The 3-Clause BSD License
  • Contains: numpy package, g++, nvcc, tensor, PyCUDA
  • Language: Python, CUDA
  • GitHub: Theano
  • Runs On: Linux, macOS, Windows
  • GitHub Discussions: None
  • Twitter: None
  • Stackflow: Theano
  • Samples: Tutorials and examples


The Theano Python library and compiler defines, optimizes, and evaluates especially matrix-valued expressions. For this purpose, it uses the NumPy package and does the following:

  • Optimization of execution speed: Theano uses nvcc or g++ to compile expression graphs into GPU or CPU instructions. These instructions execute much faster than pure Python.
  • Symbolic differentiation: It automatically builds symbolic graphs for gradients computation.
  • Stability optimizations: It recognizes and computes many numerically unstable expressions using stable algorithms.

Theano fits well with other computational tools:

  • Tensor and sparse operations
  • Linear algebra operations
  • Graph transformations
  • Lazy evaluation
  • Parallel execution
  • NumPy/basic SciPy functionality
  • Wrapping of library functions
Scroll to Top