Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
18fae10e
提交
18fae10e
authored
1月 15, 2010
作者:
Razvan Pascanu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add a short how to use shared vars
上级
22931282
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
37 行增加
和
15 行删除
+37
-15
basic.txt
doc/library/tensor/basic.txt
+36
-5
modes.txt
doc/tutorial/modes.txt
+1
-1
tools.txt
doc/tutorial/tools.txt
+0
-9
没有找到文件。
doc/library/tensor/basic.txt
浏览文件 @
18fae10e
...
...
@@ -9,7 +9,17 @@ TensorType
.. class:: TensorType
.. method:: quux()
.. _libdoc_tensor_variable
TensorVariable
==============
.. _libdoc_tensor_constant
TensorConstant
==============
...
...
@@ -155,20 +165,41 @@ bytes, we would do:
my_cmatrix = theano.tensor.TensorType('complex64', [False, False])
Shared Variable
---------------
Yet another way of creating a special type of Theano variable is by using
:func:`shared` as in the example below:
.. code-block:: python
x = shared(value, name)
Shared takes two parameters, `value` and `name` and creates a Theano
variable with the name `name` and initial value `value`. The type of this
variable is obtained from the type of the value `value`, so if value is a
numpy float matrix the shared variable will be of type `fmatrix`.
Note that a shared variable is not like other Theano variables. For more
details of how to use shared variables look :ref:`here <functionstateexample>` (or for more details
:ref:`here <sharedvars>`). TODO : make the last link to a detailed
description of shared variables.
Autocasting
-----------
TODO: What does (or compatible) mean? Talk about casting rules, refer .
Theano does autocasting of numpy ndarray or python floats/ints into
Theano constants.
TODO: What does (or compatible) mean? Talk about casting rules, refer .
TODO: link to floatX (?)
.. function:: as_tensor_variable(x, ...)
.. function:: lvector(name=None)
TODO: make a table of all [scalar, vector, matrix, tensor3, tensor4] vs. [b,
w, i, l, f, d, c, z]
Shaping and Shuffling
...
...
doc/tutorial/modes.txt
浏览文件 @
18fae10e
...
...
@@ -79,7 +79,7 @@ In the example above, there is no way to guarantee that a future call to say,
If you instantiate DebugMode using the constructor ``compile.DebugMode``
rather than the keyword ``DEBUG_MODE`` you can configure its behaviour via
constructor arguments. See :ref:`DebugMode <
compile_
debugMode>` for details.
constructor arguments. See :ref:`DebugMode <debugMode>` for details.
The keyword version of DebugMode (which you get by using ``mode='DEBUG_MODE``)
is quite strict, and can raise several different Exception types. For a
...
...
doc/tutorial/tools.txt
浏览文件 @
18fae10e
...
...
@@ -48,15 +48,6 @@ d double floating point 64
Dimensionality is one of:
====== ====== ======================================================== ===========================================================
code shape Rows :ref:`broadcastable <libdoc_tensor_broadcastable>`? Columns :ref:`broadcastable <libdoc_tensor_broadcastable>`?
====== ====== ======================================================== ===========================================================
scalar [] Yes Yes
vector [n] Yes N/A (vectors are used like row vectors)
row [1, n] Yes No
col [m, 1] No Yes
matrix [m, n] No No
====== ====== ======================================================== ============================================================
So, if you want a row of 32-bit floats, it is available
as :ref:`theano.tensor.frow <libdoc_tensor_type>`.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论