Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5d29d767
提交
5d29d767
authored
1月 15, 2010
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
差异文件
merge
上级
18fae10e
7057e6b0
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
18 行增加
和
19 行删除
+18
-19
examples.txt
doc/tutorial/examples.txt
+4
-3
modes.txt
doc/tutorial/modes.txt
+12
-14
numpy.txt
doc/tutorial/numpy.txt
+2
-2
没有找到文件。
doc/tutorial/examples.txt
浏览文件 @
5d29d767
...
@@ -274,9 +274,10 @@ shared variable, but you do *not* want to use its value. In this case, you can u
...
@@ -274,9 +274,10 @@ shared variable, but you do *not* want to use its value. In this case, you can u
for the purpose of one particular function.
for the purpose of one particular function.
>>> fn_of_state = state * 2 + inc
>>> fn_of_state = state * 2 + inc
>>> non_shared_state = state.type()
>>> foo = lscalar() # the type (lscalar) must match the shared variable we
>>> skip_shared = function([inc, non_shared_state], fn_of_state,
>>> # are replacing with the ``givens`` list
givens=[(state, non_shared_state)])
>>> skip_shared = function([inc, foo], fn_of_state,
givens=[(state, foo)])
>>> skip_shared(1, 3) # we're using 3 for the state, not state.value
>>> skip_shared(1, 3) # we're using 3 for the state, not state.value
array(7)
array(7)
>>> state.value # old state still there, but we didn't use it
>>> state.value # old state still there, but we didn't use it
...
...
doc/tutorial/modes.txt
浏览文件 @
5d29d767
...
@@ -15,9 +15,9 @@ is controlled by the value of the ``mode`` parameter.
...
@@ -15,9 +15,9 @@ is controlled by the value of the ``mode`` parameter.
Theano defines the following modes by name:
Theano defines the following modes by name:
- ``
FAST_COMPILE``: Apply just a few optimizations, but use C op
implementations where possible.
- ``
'FAST_COMPILE'``: Apply just a few graph optimizations, but use C
implementations where possible.
- ``
FAST_RUN``: Apply all optimizations, and use C op
implementations where possible.
- ``
'FAST_RUN'``: Apply all optimizations, and use C
implementations where possible.
- ``
DEBUG_MODE
``: Verify the correctness of all optimizations, and compare C and python
- ``
'DEBUG_MODE'
``: Verify the correctness of all optimizations, and compare C and python
implementations. This mode can take much longer than the other modes,
implementations. This mode can take much longer than the other modes,
but can identify many kinds of problems.
but can identify many kinds of problems.
...
@@ -43,24 +43,24 @@ DEBUG_MODE ``compile.debugmode.DebugMode()``
...
@@ -43,24 +43,24 @@ DEBUG_MODE ``compile.debugmode.DebugMode()``
Using DebugMode
Using DebugMode
===============
===============
While normally you should use the ``FAST_RUN`` or ``FAST_COMPILE`` mode,
While normally you should use the ``FAST_RUN`` or ``FAST_COMPILE`` mode,
it is useful at first to run your code using the DebugMode
it is useful at first (especially when you are defining new kinds of
expressions or new optimizations) to run your code using the DebugMode
(available via ``mode='DEBUG_MODE'``). The DebugMode is designed to
(available via ``mode='DEBUG_MODE'``). The DebugMode is designed to
do several self-checks and assertations that can help to diagnose
do several self-checks and assertations that can help to diagnose
possible programming errors that can lead to incorect output. Note that
possible programming errors that can lead to incorect output. Note that
``DEBUG_MODE`` is much slower then ``FAST_RUN`` or ``FAST_COMPILE`` so
``DEBUG_MODE`` is much slower then ``FAST_RUN`` or ``FAST_COMPILE`` so
use it only during development
,
not when you luch 1000 process on a
use it only during development
(
not when you luch 1000 process on a
cluster.
cluster
!)
.
DebugMode is used as follows:
DebugMode is used as follows:
.. code-block:: python
.. code-block:: python
x =
theano
.dvector('x')
x =
T
.dvector('x')
f = theano.function(
x
, 10*x, mode='DEBUG_MODE')
f = theano.function(
[x]
, 10*x, mode='DEBUG_MODE')
f(5)
f(5)
f(0)
f(0)
...
@@ -68,7 +68,7 @@ DebugMode is used as follows:
...
@@ -68,7 +68,7 @@ DebugMode is used as follows:
If any problem is detected, DebugMode will raise an exception according to
If any problem is detected, DebugMode will raise an exception according to
what went wrong, either at call time (
e.g. ``f(5)``) or compile time (e.g
what went wrong, either at call time (
``f(5)``) or compile time (
``f = theano.function(x, 10*x, mode='DEBUG_MODE')``). These exceptions
``f = theano.function(x, 10*x, mode='DEBUG_MODE')``). These exceptions
should *not* be ignored; talk to your local Theano guru or email the
should *not* be ignored; talk to your local Theano guru or email the
users list if you cannot make the exception go away.
users list if you cannot make the exception go away.
...
@@ -77,13 +77,11 @@ Some kinds of errors can only be detected for certain input value combinations.
...
@@ -77,13 +77,11 @@ Some kinds of errors can only be detected for certain input value combinations.
In the example above, there is no way to guarantee that a future call to say,
In the example above, there is no way to guarantee that a future call to say,
``f(-1)`` won't cause a problem. DebugMode is not a silver bullet.
``f(-1)`` won't cause a problem. DebugMode is not a silver bullet.
If you instantiate DebugMode using the constructor
``compile.DebugMode``
If you instantiate DebugMode using the constructor
(see :class:`DebugMode`)
rather than the keyword ``DEBUG_MODE`` you can configure its behaviour via
rather than the keyword ``DEBUG_MODE`` you can configure its behaviour via
constructor arguments. See :ref:`DebugMode <debugMode>` for details.
constructor arguments. See :ref:`DebugMode <debugMode>` for details.
The keyword version of DebugMode (which you get by using ``mode='DEBUG_MODE``)
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
is quite strict.
list of possible exeption go here.
.. _using_profilemode:
.. _using_profilemode:
...
...
doc/tutorial/numpy.txt
浏览文件 @
5d29d767
...
@@ -50,7 +50,7 @@ Broadcasting
...
@@ -50,7 +50,7 @@ Broadcasting
Numpy does *broadcasting* of arrays of different shapes during
Numpy does *broadcasting* of arrays of different shapes during
arithmetic operations. What this means in general is that the smaller
arithmetic operations. What this means in general is that the smaller
array is *broadcasted* across the larger array so that they have
array
(or scalar)
is *broadcasted* across the larger array so that they have
compatible shapes. The example below shows an instance of
compatible shapes. The example below shows an instance of
*broadcastaing*:
*broadcastaing*:
...
@@ -59,7 +59,7 @@ compatible shapes. The example below shows an instance of
...
@@ -59,7 +59,7 @@ compatible shapes. The example below shows an instance of
>>> a * b
>>> a * b
array([2., 4., 6.])
array([2., 4., 6.])
The smaller array ``b`` in this case is *broadcasted* to the same size
The smaller array ``b``
(actually a scalar here, which works like a 0-d array)
in this case is *broadcasted* to the same size
as ``a`` during the multiplication. This trick is often useful in
as ``a`` during the multiplication. This trick is often useful in
simplifying how expression are written. More details about *broadcasting*
simplifying how expression are written. More details about *broadcasting*
can be found at `numpy user guide <http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html>`__.
can be found at `numpy user guide <http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html>`__.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论