Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c4b6dca9
提交
c4b6dca9
authored
6月 30, 2010
作者:
Razvan Pascanu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
polishing comments in scan.py
上级
9a9e91a8
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
19 行增加
和
16 行删除
+19
-16
scan.py
theano/scan.py
+19
-16
没有找到文件。
theano/scan.py
浏览文件 @
c4b6dca9
...
@@ -239,8 +239,8 @@ def scan(fn, sequences=[], outputs_info=[], non_sequences=[],
...
@@ -239,8 +239,8 @@ def scan(fn, sequences=[], outputs_info=[], non_sequences=[],
If you are using shared variables over which you do not want to iterate,
If you are using shared variables over which you do not want to iterate,
you do not need to provide them as arguments to ``fn``, though you can if you
you do not need to provide them as arguments to ``fn``, though you can if you
wish so. The function should return the outputs after each step plus the updates
for
wish so. The function should return the outputs after each step plus the updates
any of the shared variables. You can either return only outputs or only
for
any of the shared variables. You can either return only outputs or only
updates. If you have both outputs and updates the function should return
updates. If you have both outputs and updates the function should return
them as a tuple : (outputs, updates) or (updates, outputs).
them as a tuple : (outputs, updates) or (updates, outputs).
...
@@ -279,9 +279,10 @@ def scan(fn, sequences=[], outputs_info=[], non_sequences=[],
...
@@ -279,9 +279,10 @@ def scan(fn, sequences=[], outputs_info=[], non_sequences=[],
list of ints (only negative .. since you can not use future values of outputs),
list of ints (only negative .. since you can not use future values of outputs),
with the same meaning as for ``sequences`` (see above).
with the same meaning as for ``sequences`` (see above).
* ``inplace`` -- theano variable pointing to one of the input sequences; this
* ``inplace`` -- theano variable pointing to one of the input sequences; this
flag tells scan that the output should be computed in the memory space
d
occupied
flag tells scan that the output should be computed in the memory space occupied
by that input sequence. Note that scan will only do this if allowed by the
by that input sequence. Note that scan will only do this if allowed by the
rest of your computational graph and if you are not using past taps of the input.
rest of your computational graph and if you are not using past taps of the
input.
* ``return_steps`` how many steps to return from your output. If not given, or
* ``return_steps`` how many steps to return from your output. If not given, or
0 scan will return all steps, otherwise it will return the last ``return_steps``.
0 scan will return all steps, otherwise it will return the last ``return_steps``.
Note that if you set this to something else then 0, scan will try to be smart
Note that if you set this to something else then 0, scan will try to be smart
...
@@ -296,8 +297,8 @@ def scan(fn, sequences=[], outputs_info=[], non_sequences=[],
...
@@ -296,8 +297,8 @@ def scan(fn, sequences=[], outputs_info=[], non_sequences=[],
notation, when ``t = 0``, we would need values for ``y[-1]``, ``y[-2]``
notation, when ``t = 0``, we would need values for ``y[-1]``, ``y[-2]``
and ``y[-4]``. These values are provided by the initial state of ``y``,
and ``y[-4]``. These values are provided by the initial state of ``y``,
which should have same number of dimension as ``y``, where the first
which should have same number of dimension as ``y``, where the first
dimension should be large enough to cover all
past values, which in this
dimension should be large enough to cover all
the required past values, which in
case is 4. If ``init_y`` is the variable containing the initial state
this
case is 4. If ``init_y`` is the variable containing the initial state
of ``y``, then ``init_y[0]`` corresponds to ``y[-4]``, ``init_y[1]``
of ``y``, then ``init_y[0]`` corresponds to ``y[-4]``, ``init_y[1]``
corresponds to ``y[-3]``, ``init_y[2]`` corresponds to ``y[-2]``,
corresponds to ``y[-3]``, ``init_y[2]`` corresponds to ``y[-2]``,
``init_y[3]`` corresponds to ``y[-1]``. The default behaviour of scan is
``init_y[3]`` corresponds to ``y[-1]``. The default behaviour of scan is
...
@@ -311,13 +312,13 @@ def scan(fn, sequences=[], outputs_info=[], non_sequences=[],
...
@@ -311,13 +312,13 @@ def scan(fn, sequences=[], outputs_info=[], non_sequences=[],
of -1
of -1
* if you wrap an output in a dictionary but you do not provide any initial state,
* if you wrap an output in a dictionary but you do not provide any initial state,
it assumes that you are not using any form of taps
it assumes that you are not using any form of taps
* if you provide a ``None``
scan assumes that you will not use any taps for thi
s
* if you provide a ``None``
instead of a variable or a dictionary scan assume
s
output (this would be the case for map
)
that you will not use any taps for this output (this would be the case for map
)
If you did not provide any information for your outputs, scan will assume by
default
If you did not provide any information for your outputs, scan will assume by
that you are not using any taps for any of the outputs. If you provide information for
default that you are not using any taps for any of the outputs. If you provide
just a subset of outputs, scan will not know to which outputs these information
information for just a subset of outputs, scan will not know to which outputs
corresponds
and will raise an error.
these correspond
and will raise an error.
:param non_sequences:
:param non_sequences:
Parameters over which scan should not iterate. These parameters are
Parameters over which scan should not iterate. These parameters are
...
@@ -330,18 +331,20 @@ def scan(fn, sequences=[], outputs_info=[], non_sequences=[],
...
@@ -330,18 +331,20 @@ def scan(fn, sequences=[], outputs_info=[], non_sequences=[],
the input sequences. If the value is 0, the outputs will have 0 rows. If the
the input sequences. If the value is 0, the outputs will have 0 rows. If the
value is negative, scan will run backwards (or if the flag go_backwards is
value is negative, scan will run backwards (or if the flag go_backwards is
already set to true it will run forward in time). If n_steps is not provided,
already set to true it will run forward in time). If n_steps is not provided,
or evaluetes to None, inf or nan, scan will figure out the maximal amount of
steps it can
or evaluetes to None, inf or nan, scan will figure out the maximal amount of
take and do that.
steps it can run given the input sequences and do that.
:param truncate_gradient:
:param truncate_gradient:
Number of steps to use in truncated BPTT. If you compute gradients
Number of steps to use in truncated BPTT. If you compute gradients
through a scan op, they are computed using backpropagation through time.
through a scan op, they are computed using backpropagation through time.
By providing a different value then -1, you choose to use truncated BPTT
By providing a different value then -1, you choose to use truncated BPTT
instead of classical BPTT, where you only do ``truncate_gradient``
instead of classical BPTT, where you only do ``truncate_gradient``
number of steps.
(NOT YET IMPLEMENTED)
number of steps.
:param go_backwards:
:param go_backwards:
Flag indicating if you should go backwards through the sequences
Flag indicating if you should go backwards through the sequences ( if you
think as the sequences being indexed by time, this would mean go backwards
in time)
:param name:
:param name:
The name of the theano function compiled by the Scan op. It will show in the
The name of the theano function compiled by the Scan op. It will show in the
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论