theano
- Version:
1.0.5
- Category:
ai
- Cluster:
Loki
Description
Theano is a deep learning library and optimizing compiler for numerical computation in Python. It allows users to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently.
Version 1.0.5 is the final official release of Theano. It includes:
GPU acceleration via CUDA 10.2
Just-In-Time (JIT) compilation with GCC 8
NumPy integration for efficient scientific computing
Symbolic differentiation, loop optimization, and memory reuse
Compatibility with legacy deep learning frameworks (e.g., Lasagne, Blocks)
Documentation
theano.__version__ → "1.0.5"
Configuration:
----------------
$ THEANO_FLAGS=device=gpu,floatX=float32
Import and compile a function:
------------------------------
>>> import theano
>>> import theano.tensor as T
>>> x = T.dscalar('x')
>>> y = T.dscalar('y')
>>> z = x + y
>>> f = theano.function([x, y], z)
>>> f(2, 3) # Returns 5.0
Config options:
- device=[cpu|gpu]
- floatX=[float32|float64]
- optimizer=[fast_run|fast_compile|None]
- mode=[FAST_RUN|FAST_COMPILE|DEBUG]
Help:
>>> theano.config
>>> theano.printing.pydotprint()
Examples/Usage
Load the module:
$ module load theano-py37-cuda10.2-gcc/1.0.5
Example Python session using GPU:
import theano
from theano import tensor as T
x = T.fscalar('x')
y = T.fscalar('y')
z = x * y
f = theano.function([x, y], z)
print(f(3.0, 4.0)) # Output: 12.0
Set GPU environment:
$ export THEANO_FLAGS=device=gpu,floatX=float32
Unload the module:
$ module unload theano-py37-cuda10.2-gcc/1.0.5
Installation
Source code is obtained from Theano