Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
e45ce1c4
提交
e45ce1c4
authored
4月 18, 2012
作者:
David Warde-Farley
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Spurious whitespace.
上级
3cfd3f3f
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
85 行增加
和
85 行删除
+85
-85
function.txt
doc/library/compile/function.txt
+6
-6
basic.txt
doc/library/tensor/basic.txt
+79
-79
没有找到文件。
doc/library/compile/function.txt
浏览文件 @
e45ce1c4
...
...
@@ -46,7 +46,7 @@ Reference
.. method:: __init__(variable, borrow=False)
Initialize attributes from arguments.
Initialize attributes from arguments.
.. class:: Param
...
...
@@ -57,21 +57,21 @@ Reference
A variable in an expression graph to use as a compiled-function parameter
.. attribute:: default
The default value to use at call-time (can also be a Container where
the function will find a value at call-time.)
.. attribute:: name
.. attribute:: name
A string to identify an argument for this parameter in keyword arguments.
.. attribute:: mutable
``True`` means the compiled-function is allowed to modify this
argument. ``False`` means it is not allowed.
.. attribute:: strict
If ``False``, a function argument may be copied or cast to match the type
required by the parameter `variable`. If ``True``, a function argument
must exactly match the type required by `variable`.
...
...
doc/library/tensor/basic.txt
浏览文件 @
e45ce1c4
...
...
@@ -11,7 +11,7 @@ symbolic matrix expressions. When you type,
>>> x = T.fmatrix()
the ``x`` is a :class:`TensorVariable` instance.
The ``T.fmatrix`` object itself is an instance of :class:`TensorType`.
The ``T.fmatrix`` object itself is an instance of :class:`TensorType`.
Theano knows what type of variable ``x`` is because ``x.type``
points back to ``T.fmatrix``.
...
...
@@ -98,71 +98,71 @@ They are all callable, and accept an optional ``name`` argument. So for example
xyz = dmatrix('xyz') # creates one Variable with name 'xyz'
.. #COMMENT
table generated by
table generated by
$ python Theano/doc/generate_dtype_tensor_table.py
============ =========== ==== =========== =================================
Constructor dtype ndim shape broadcastable
============ =========== ==== =========== =================================
bscalar int8 0 () ()
bvector int8 1 (?,) (False,)
brow int8 2 (1,?) (True, False)
bcol int8 2 (?,1) (False, True)
bmatrix int8 2 (?,?) (False, False)
bscalar int8 0 () ()
bvector int8 1 (?,) (False,)
brow int8 2 (1,?) (True, False)
bcol int8 2 (?,1) (False, True)
bmatrix int8 2 (?,?) (False, False)
btensor3 int8 3 (?,?,?) (False, False, False)
btensor4 int8 4 (?,?,?,?) (False, False, False, False)
wscalar int16 0 () ()
wvector int16 1 (?,) (False,)
wrow int16 2 (1,?) (True, False)
wcol int16 2 (?,1) (False, True)
wmatrix int16 2 (?,?) (False, False)
wscalar int16 0 () ()
wvector int16 1 (?,) (False,)
wrow int16 2 (1,?) (True, False)
wcol int16 2 (?,1) (False, True)
wmatrix int16 2 (?,?) (False, False)
wtensor3 int16 3 (?,?,?) (False, False, False)
wtensor4 int16 4 (?,?,?,?) (False, False, False, False)
iscalar int32 0 () ()
ivector int32 1 (?,) (False,)
irow int32 2 (1,?) (True, False)
icol int32 2 (?,1) (False, True)
imatrix int32 2 (?,?) (False, False)
iscalar int32 0 () ()
ivector int32 1 (?,) (False,)
irow int32 2 (1,?) (True, False)
icol int32 2 (?,1) (False, True)
imatrix int32 2 (?,?) (False, False)
itensor3 int32 3 (?,?,?) (False, False, False)
itensor4 int32 4 (?,?,?,?) (False, False, False, False)
lscalar int64 0 () ()
lvector int64 1 (?,) (False,)
lrow int64 2 (1,?) (True, False)
lcol int64 2 (?,1) (False, True)
lmatrix int64 2 (?,?) (False, False)
lscalar int64 0 () ()
lvector int64 1 (?,) (False,)
lrow int64 2 (1,?) (True, False)
lcol int64 2 (?,1) (False, True)
lmatrix int64 2 (?,?) (False, False)
ltensor3 int64 3 (?,?,?) (False, False, False)
ltensor4 int64 4 (?,?,?,?) (False, False, False, False)
dscalar float64 0 () ()
dvector float64 1 (?,) (False,)
drow float64 2 (1,?) (True, False)
dcol float64 2 (?,1) (False, True)
dmatrix float64 2 (?,?) (False, False)
dscalar float64 0 () ()
dvector float64 1 (?,) (False,)
drow float64 2 (1,?) (True, False)
dcol float64 2 (?,1) (False, True)
dmatrix float64 2 (?,?) (False, False)
dtensor3 float64 3 (?,?,?) (False, False, False)
dtensor4 float64 4 (?,?,?,?) (False, False, False, False)
fscalar float32 0 () ()
fvector float32 1 (?,) (False,)
frow float32 2 (1,?) (True, False)
fcol float32 2 (?,1) (False, True)
fmatrix float32 2 (?,?) (False, False)
fscalar float32 0 () ()
fvector float32 1 (?,) (False,)
frow float32 2 (1,?) (True, False)
fcol float32 2 (?,1) (False, True)
fmatrix float32 2 (?,?) (False, False)
ftensor3 float32 3 (?,?,?) (False, False, False)
ftensor4 float32 4 (?,?,?,?) (False, False, False, False)
cscalar complex64 0 () ()
cvector complex64 1 (?,) (False,)
crow complex64 2 (1,?) (True, False)
ccol complex64 2 (?,1) (False, True)
cmatrix complex64 2 (?,?) (False, False)
cscalar complex64 0 () ()
cvector complex64 1 (?,) (False,)
crow complex64 2 (1,?) (True, False)
ccol complex64 2 (?,1) (False, True)
cmatrix complex64 2 (?,?) (False, False)
ctensor3 complex64 3 (?,?,?) (False, False, False)
ctensor4 complex64 4 (?,?,?,?) (False, False, False, False)
zscalar complex128 0 () ()
zvector complex128 1 (?,) (False,)
zrow complex128 2 (1,?) (True, False)
zcol complex128 2 (?,1) (False, True)
zmatrix complex128 2 (?,?) (False, False)
zscalar complex128 0 () ()
zvector complex128 1 (?,) (False,)
zrow complex128 2 (1,?) (True, False)
zcol complex128 2 (?,1) (False, True)
zmatrix complex128 2 (?,?) (False, False)
ztensor3 complex128 3 (?,?,?) (False, False, False)
ztensor4 complex128 4 (?,?,?,?) (False, False, False, False)
============ =========== ==== =========== =================================
Plural Constructors
Plural Constructors
--------------------------
There are several constructors that can produce multiple variables at once.
...
...
@@ -188,7 +188,7 @@ These are not frequently used in practice, but often used in tutorial examples t
Return one or more matrix variables.
Each of these plural constructors accepts
Each of these plural constructors accepts
an integer or several strings. If an integer is provided, the method
will return that many Variables and if strings are provided, it will
create one Variable for each string, using the string as the Variable's
...
...
@@ -251,7 +251,7 @@ Finally, when you use a numpy ndarry or a Python number together with
Theano requires that the inputs to all expressions be Variable instances, so
Theano automatically wraps them in a :class:`TensorConstant`.
.. note::
.. note::
Theano makes a copy of any ndarray that you use in an expression, so
subsequent
...
...
@@ -288,7 +288,7 @@ them perfectly, but a dscalar otherwise.
When `x` is a `list` or `tuple` it is passed through numpy.asarray
If the `ndim` argument is not None, it must be an integer and the output
will be broadcasted if necessary in order to have this many dimensions.
will be broadcasted if necessary in order to have this many dimensions.
:rtype: :class:`TensorVariable` or :class:`TensorConstant`
...
...
@@ -304,7 +304,7 @@ TensorType and TensorVariable
:ref:`the tutorial's graph-structure figure <tutorial-graphfigure>` is an instance of this class.
.. attribute:: broadcastable
A tuple of True/False values, one for each dimension. True in
position 'i' indicates that at evaluation-time, the ndarray will have
size 1 in that 'i'-th dimension. Such a dimension is called a
...
...
@@ -349,7 +349,7 @@ TensorType and TensorVariable
adding them together, we would define it like this:
>>> middle_broadcaster = TensorType('complex64', [False, True, False])
.. attribute:: ndim
The number of dimensions that a Variable's value will have at
...
...
@@ -362,7 +362,7 @@ TensorType and TensorVariable
the numerical type of the ndarray for which a Variable of this Type
is standing.
.. _dtype_list:
.. _dtype_list:
The dtype attribute of a TensorType instance can be any of the
following strings.
...
...
@@ -386,7 +386,7 @@ TensorType and TensorVariable
.. method:: __init__(self, dtype, broadcastable)
If you wish to use a type of tensor which is not already available
If you wish to use a type of tensor which is not already available
(for example, a 5D tensor) you can build an appropriate type by instantiating
:class:`TensorType`.
...
...
@@ -433,7 +433,7 @@ TensorVariable
.. attribute:: dtype
The numeric type of this tensor. Aliased to
The numeric type of this tensor. Aliased to
:attr:`TensorType.dtype`.
.. method:: reshape(shape, ndim=None)
...
...
@@ -476,10 +476,10 @@ TensorVariable
Transpose of this tensor.
>>> x = T.zmatrix()
>>> y = 3+.2j * x.T
>>> y = 3+.2j * x.T
.. note::
In numpy and in Theano, the transpose of a vector is exactly the
same vector! Use `reshape` or `dimshuffle` to turn your vector
into a row or column matrix.
...
...
@@ -510,20 +510,20 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`.
:rtype: variable with x's dtype, but ndim dimensions
.. note::
.. note::
This function can infer the length of a symbolic newshape in some
cases, but if it cannot and you do not provide the `ndim`, then this
function will raise an Exception.
.. function:: shape_padleft(x, n_ones=1)
Reshape `x` by left padding the shape with `n_ones` 1s. Note that all
this new dimension will be broadcastable. To make them non-broadcastable
Reshape `x` by left padding the shape with `n_ones` 1s. Note that all
this new dimension will be broadcastable. To make them non-broadcastable
see the :func:`unbroadcast`.
:param x: variable to be reshaped
:param x: variable to be reshaped
:type x: any TensorVariable (or compatible)
:type n_ones: int
...
...
@@ -533,11 +533,11 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`.
.. function:: shape_padright(x,n_ones = 1)
Reshape `x` by right padding the shape with `n_ones` 1s. Note that all
this new dimension will be broadcastable. To make them non-broadcastable
Reshape `x` by right padding the shape with `n_ones` 1s. Note that all
this new dimension will be broadcastable. To make them non-broadcastable
see the :func:`unbroadcast`.
:param x: variable to be reshaped
:param x: variable to be reshaped
:type x: any TensorVariable (or compatible)
:type n_ones: int
...
...
@@ -557,7 +557,7 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`.
along that dimension is not 1, a ``ValueError`` will be raised.
.. function:: flatten(x, outdim=1)
Similar to :func:`reshape`, but the shape is inferred from the shape of `x`.
:param x: variable to be flattened
...
...
@@ -591,7 +591,7 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`.
.. function:: fill(a,b)
:param a: tensor that has same shape as output
:param a: tensor that has same shape as output
:param b: theano scalar or value with which you want to fill the output
Create a matrix by filling the shape of `a` with `b`
...
...
@@ -600,9 +600,9 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`.
:param n: number of rows in output (value or theano scalar)
:param m: number of columns in output (value or theano scalar)
:param k: Index of the diagonal: 0 refers to the main diagonal,
a positive value refers to an upper diagonal, and a
negative value to a lower diagonal. It can be a theano
:param k: Index of the diagonal: 0 refers to the main diagonal,
a positive value refers to an upper diagonal, and a
negative value to a lower diagonal. It can be a theano
scalar.
:returns: An array where all elements are equal to zero, except for the `k`-th
diagonal, whose values are equal to one.
...
...
@@ -644,7 +644,7 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`.
>>> # x.ndim == 2
Reductions
Reductions
==========
...
...
@@ -654,7 +654,7 @@ Reductions
:Parameter: *axis* - axis along which to compute the maximum
:Returns: the maximum value along a given axis
:note: see maximum for elemwise max
if axis=None, Theano 0.5rc1 or later: max over the flattened tensor (like numpy)
older: then axis is assumed to be ndim(x)-1
...
...
@@ -834,7 +834,7 @@ Casting
Cast any tensor `x` to a Tensor of the same shape, but with a different
numerical type `dtype`.
This is not a reinterpret cast, but a coersion cast, similar to
``numpy.asarray(x, dtype=dtype)``.
...
...
@@ -850,12 +850,12 @@ Casting
.. function:: real(x)
Return the real (not imaginary) components of Tensor x.
Return the real (not imaginary) components of Tensor x.
For non-complex `x` this function returns x.
.. function:: imag(x)
Return the imaginary components of Tensor x.
Return the imaginary components of Tensor x.
For non-complex `x` this function returns zeros_like(x).
...
...
@@ -875,7 +875,7 @@ The six usual equality and inequality operators share the same interface.
Here is an example with the less-than operator.
.. code-block:: python
.. code-block:: python
import theano.tensor as T
x,y = T.dmatrices('x','y')
...
...
@@ -927,7 +927,7 @@ Condition
:Parameter: *iff* - symbolic Tensor (or compatible)
:Return type: symbolic Tensor
.. code-block:: python
.. code-block:: python
import theano.tensor as T
a,b = T.dmatrices('a','b')
...
...
@@ -945,14 +945,14 @@ Bit-wise
--------
The bitwise operators possess this interface:
The bitwise operators possess this interface:
:Parameter: *a* - symbolic Tensor of integer type.
:Parameter: *b* - symbolic Tensor of integer type.
.. note::
.. note::
The bitwise operators must have an integer type as input.
The bit-wise not (invert) takes only one parameter.
:Return type: symbolic Tensor with corresponding dtype.
...
...
@@ -991,7 +991,7 @@ The bitwise operators possess this interface:
Here is an example using the bit-wise ``and_`` via the ``&`` operator:
.. code-block:: python
.. code-block:: python
import theano.tensor as T
x,y = T.imatrices('x','y')
...
...
@@ -1137,7 +1137,7 @@ Linear Algebra
:param Y: right term
:type X: symbolic vector
:type Y: symbolic vector
:rtype: symbolic matrix
:rtype: symbolic matrix
:return: vector-vector outer product
...
...
@@ -1150,7 +1150,7 @@ Linear Algebra
:param axes: sum out these axes from X and Y.
:type X: symbolic tensor
:type Y: symbolic tensor
:rtype: symbolic tensor
:rtype: symbolic tensor
:type axes: see numpy.tensordot
:return: tensor product
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论