Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
e17c495f
提交
e17c495f
authored
4月 08, 2011
作者:
Razvan Pascanu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed depricated refrences to other_ignore arguments (they were not used
by the code .. and just reduced the readability of the code ) - all scan tests still pass
上级
4fc3c1b2
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
7 行增加
和
24 行删除
+7
-24
__init__.py
theano/scan_module/__init__.py
+2
-2
scan.py
theano/scan_module/scan.py
+2
-14
scan_op.py
theano/scan_module/scan_op.py
+3
-7
scan_utils.py
theano/scan_module/scan_utils.py
+0
-1
没有找到文件。
theano/scan_module/__init__.py
浏览文件 @
e17c495f
...
...
@@ -646,7 +646,7 @@ if cuda.cuda_available:
+
thescan
.
n_shared_outs
)
nw_ins
+=
[
safe_to_gpu
(
x
)
for
x
in
inputs
[
1
:
e
]
]
b
=
e
e
=
e
+
thescan
.
n_nit_sot
+
thescan
.
n_other_ignore
e
=
e
+
thescan
.
n_nit_sot
nw_ins
+=
inputs
[
b
:
e
]
nw_ins
+=
[
safe_to_gpu
(
x
)
for
x
in
inputs
[
e
:]
]
scan_ins
=
[
tensor_to_cuda
(
x
)
for
x
in
thescan
.
inputs
]
...
...
@@ -678,7 +678,7 @@ if cuda.cuda_available:
+
thescan
.
n_shared_outs
)
nw_ins
+=
[
safe_to_gpu
(
x
)
for
x
in
inputs
[
1
:
e
]
]
b
=
e
e
=
e
+
thescan
.
n_nit_sot
+
thescan
.
n_other_ignore
e
=
e
+
thescan
.
n_nit_sot
nw_ins
+=
inputs
[
b
:
e
]
nw_ins
+=
[
safe_to_gpu
(
x
)
for
x
in
inputs
[
e
:]
]
...
...
theano/scan_module/scan.py
浏览文件 @
e17c495f
...
...
@@ -759,23 +759,14 @@ def scan( fn
nit_sot_rightOrder
.
append
(
i
)
n_nit_sot
+=
1
## Step 5.5 Sequences with no taps used
n_other_ignore
=
0
ignore_scan_seqs
=
[]
ignore_inner_seqs
=
[]
for
i
,
seq
in
enumerate
(
seqs
):
if
not
'taps'
in
seq
:
ignore_scan_seqs
.
append
(
seq
[
'input'
])
n_other_ignore
+=
1
## Step 5.6 all other arguments including extra inputs
## Step 5.5 all other arguments including extra inputs
other_scan_args
=
[]
other_inner_args
=
[]
other_scan_args
+=
[
arg
for
arg
in
non_seqs
if
not
isinstance
(
arg
,
SharedVariable
)
]
## Step 5.
8
all shared variables with no update rules
## Step 5.
6
all shared variables with no update rules
def
new_variable
(
v
):
new_v
=
safe_new
(
v
)
if
v
.
name
:
...
...
@@ -805,7 +796,6 @@ def scan( fn
mit_sot_inner_inputs
+
sit_sot_inner_inputs
+
shared_inner_inputs
+
ignore_inner_seqs
+
other_shared_inner_args
+
other_inner_args
)
...
...
@@ -850,7 +840,6 @@ def scan( fn
info
[
'n_sit_sot'
]
=
n_sit_sot
info
[
'n_shared_outs'
]
=
n_shared_outs
info
[
'n_nit_sot'
]
=
n_nit_sot
info
[
'n_other_ignore'
]
=
n_other_ignore
info
[
'truncate_gradient'
]
=
truncate_gradient
info
[
'name'
]
=
name
info
[
'mode'
]
=
mode
...
...
@@ -876,7 +865,6 @@ def scan( fn
sit_sot_scan_inputs
+
shared_scan_inputs
+
[
actual_n_steps
for
x
in
xrange
(
n_nit_sot
)
]
+
ignore_scan_seqs
+
other_shared_scan_args
+
other_scan_args
)
...
...
theano/scan_module/scan_op.py
浏览文件 @
e17c495f
...
...
@@ -427,7 +427,7 @@ class Scan(Op):
outs
[
idx
][
0
]
=
args
[
self
.
seqs_arg_offset
+
idx
]
.
copy
()
offset
=
self
.
nit_sot_arg_offset
+
self
.
n_nit_sot
+
self
.
n_other_ignore
offset
=
self
.
nit_sot_arg_offset
+
self
.
n_nit_sot
other_args
=
args
[
offset
:]
zipped_outs
=
[(
outs
[
idx
],
self
.
vector_outs
[
idx
],
tap
,
store_steps
[
idx
],
idx
)
for
idx
in
xrange
(
self
.
n_outs
)
...
...
@@ -595,7 +595,7 @@ class Scan(Op):
outs_shape
+=
[
input_shapes
[
idx
+
offset
]
]
# non_sequences
offset
+=
self
.
n_nit_sot
+
self
.
n_
other_ignore
+
self
.
n_
shared_outs
offset
+=
self
.
n_nit_sot
+
self
.
n_shared_outs
inner_ins_shapes
=
seqs_shape
+
outs_shape
+
input_shapes
[
offset
:]
assert
len
(
inner_ins_shapes
)
==
len
(
self
.
inputs
)
...
...
@@ -940,10 +940,8 @@ class Scan(Op):
info
[
'name'
]
=
None
info
[
'mode'
]
=
self
.
mode
info
[
'inplace'
]
=
False
info
[
'n_other_ignore'
]
=
0
n_mit_sot
=
0
n_sit_sot
=
0
n_other_ignore_seqs
=
0
if
self
.
truncate_gradient
!=
-
1
:
do_steps
=
tensor
.
minimum
(
args
[
0
],
self
.
truncate_gradient
)
else
:
...
...
@@ -955,8 +953,7 @@ class Scan(Op):
+
self
.
n_mit_sot
+
self
.
n_sit_sot
+
self
.
n_nit_sot
+
self
.
n_shared_outs
+
self
.
n_other_ignore
)
+
self
.
n_shared_outs
)
scan_inputs
=
(
[
do_steps
]
+
scan_seqs
+
...
...
@@ -999,7 +996,6 @@ class Scan(Op):
gradients
+=
[
x
[::
-
1
]
for
x
in
outputs
[:
end
]]
gradients
+=
[
None
for
x
in
xrange
(
self
.
n_shared_outs
)]
gradients
+=
[
None
for
x
in
xrange
(
self
.
n_nit_sot
)
]
gradients
+=
[
None
for
x
in
xrange
(
self
.
n_other_ignore
)
]
begin
=
end
+
self
.
n_seqs
end
=
begin
+
n_shared_outs
...
...
theano/scan_module/scan_utils.py
浏览文件 @
e17c495f
...
...
@@ -754,7 +754,6 @@ def compress_outs(op, not_required, inputs):
info
[
'n_sit_sot'
]
=
0
info
[
'n_shared_outs'
]
=
0
info
[
'n_nit_sot'
]
=
0
info
[
'n_other_ignore'
]
=
op
.
info
[
'n_other_ignore'
]
info
[
'truncate_gradient'
]
=
op
.
info
[
'truncate_gradient'
]
info
[
'name'
]
=
op
.
info
[
'name'
]
info
[
'inplace'
]
=
op
.
info
[
'inplace'
]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论