Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
3bc6876a
提交
3bc6876a
authored
7月 22, 2011
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove reference to a previous way of using the ``until`` class.
上级
178b3384
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
4 行增加
和
19 行删除
+4
-19
scan.py
theano/scan_module/scan.py
+4
-19
没有找到文件。
theano/scan_module/scan.py
浏览文件 @
3bc6876a
...
...
@@ -146,7 +146,7 @@ def scan( fn
outputs ordered in the same order as ``outputs_info``, with the
difference that there should be only one output variable per
output initial state (even if no tap value is used). Secondly
`fn` should return an update dictionary (
that tells how to
`fn` should return an update dictionary (that tells how to
update any shared variable after each iteration step). The
dictionary can optionally be given as a list of tuples. There is
no constraint on the order of these two list, ``fn`` can return
...
...
@@ -157,31 +157,16 @@ def scan( fn
To use ``scan`` as a while loop, the user needs to change the
function ``fn`` such that also a stopping condition is returned.
To do so, he/she needs to wrap the condition in an ``until`` class.
The condition can be returned as a third element, or all the other
outputs and updates can be wrapped in ``until``. A few examples
would be :
The condition should be returned as a third element, for example:
.. code-block:: python
...
return [y1_t, y2_t], {x:x+1}, theano.scan_module.until(x < 50)
or
.. code-block:: python
...
return theano.scan_module.until(x<50, [y1_t, y2_t], {x:x+1})
Note that a number of steps ( considered in here as the maximum
Note that a number of steps (considered in here as the maximum
number of steps ) is still required even though a condition is
passed ( and it is used to allocate memory if needed ). Also when
passing multiple argument to ``until`` be aware of its signature:
.. code-block:: python
class until(object):
def __init__( condition, outputs = [], updates = {}):
passed (and it is used to allocate memory if needed). = {}):
:param sequences:
``sequences`` is the list of Theano variables or dictionaries
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论