Broadcasting is a mechanism which allows tensors with different numbers of dimensions to be used in element-by-element (elementwise) computations. It works by (virtually) replicating the smaller tensor along the dimensions that it is lacking.
For more detail, see Broadcasting in Theano vs. Numpy, and also * SciPy documentation about numpy’s broadcasting * OnLamp article about numpy’s broadcasting
A variable with an immutable value. For example, when you type
>>> x = tensor.ivector()
>>> y = x + 3
Then a constant is created to represent the 3 in the graph.
See also: gof.Constant
An elementwise operation f on two tensor variables M and N is one such that:
f(M, N)[i, j] == f(M[i, j], N[i, j])
In other words, each element of an input matrix is combined with the corresponding element of the other(s). There are no dependencies between elements whose [i, j] coordinates do not correspond, so an elementwise operation is like a scalar operation generalized along several dimensions. Elementwise operations are defined for tensors of different numbers of dimensions by broadcasting the smaller ones.
A directed, acyclic set of connected Variable and Apply nodes that express symbolic functional relationship between variables. You use Theano by defining expression graphs, and then compiling them with theano.function.
See also Variable, Op, Apply, and Type, or read more about Graph Structures.
An Op is destructive (of particular input[s]) if its computation requires that one or more inputs be overwritten or otherwise invalidated. For example, inplace Ops are destructive. Destructive Ops can sometimes be faster than non-destructive alternatives. Theano encourages users not to put destructive Ops into graphs that are given to theano.function, but instead to trust the optimizations to insert destructive ops judiciously.
Destructive Ops are indicated via a destroy_map Op attribute. (See gof.Op.
The .op of an Apply, together with its symbolic inputs fully determines what kind of computation will be carried out for that Apply at run-time. Mathematical functions such as addition (T.add) and indexing x[i] are Ops in Theano. Much of the library documentation is devoted to describing the various Ops that are provided with Theano, but you can add more.
See also Variable, Type, and Apply, or read more about Graph Structures.
The .type of a Variable indicates what kinds of values might be computed for it in a compiled graph. An instance that inherits from Type, and is used as the .type attribute of a Variable.
See also Variable, Op, and Apply, or read more about Graph Structures.
The the main data structure you work with when using Theano. For example,
>>> x = theano.tensor.ivector()
>>> y = -x**2
x and y are both Variables, i.e. instances of the Variable class.
See also Type, Op, and Apply, or read more about Graph Structures.
Some Tensor Ops (such as Subtensor and Transpose) can be computed in constant time by simply re-indexing their inputs. The outputs from [the Apply instances from] such Ops are called Views because their storage might be aliased to the storage of other variables (the inputs of the Apply). It is important for Theano to know which Variables are views of which other ones in order to introduce Destructive Ops correctly.
View Ops are indicated via a view_map Op attribute. (See gof.Op.