Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
1fef9423
提交
1fef9423
authored
7月 02, 2015
作者:
Iban Harlouchet
提交者:
Frederic
7月 23, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
flake8 fortheano/tensor/nnet/conv3d2d.py
上级
80a8289d
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
14 行增加
和
15 行删除
+14
-15
conv3d2d.py
theano/tensor/nnet/conv3d2d.py
+14
-14
test_flake8.py
theano/tests/test_flake8.py
+0
-1
没有找到文件。
theano/tensor/nnet/conv3d2d.py
浏览文件 @
1fef9423
...
@@ -194,13 +194,13 @@ def conv3d(signals, filters,
...
@@ -194,13 +194,13 @@ def conv3d(signals, filters,
_signals_shape_5d
[
2
],
_signals_shape_5d
[
2
],
_signals_shape_5d
[
3
],
_signals_shape_5d
[
3
],
_signals_shape_5d
[
4
],
_signals_shape_5d
[
4
],
)
)
_filters_shape_4d
=
(
_filters_shape_4d
=
(
_filters_shape_5d
[
0
]
*
_filters_shape_5d
[
1
],
_filters_shape_5d
[
0
]
*
_filters_shape_5d
[
1
],
_filters_shape_5d
[
2
],
_filters_shape_5d
[
2
],
_filters_shape_5d
[
3
],
_filters_shape_5d
[
3
],
_filters_shape_5d
[
4
],
_filters_shape_5d
[
4
],
)
)
if
border_mode
[
1
]
!=
border_mode
[
2
]:
if
border_mode
[
1
]
!=
border_mode
[
2
]:
raise
NotImplementedError
(
'height and width bordermodes must match'
)
raise
NotImplementedError
(
'height and width bordermodes must match'
)
...
@@ -228,7 +228,7 @@ def conv3d(signals, filters,
...
@@ -228,7 +228,7 @@ def conv3d(signals, filters,
_filters_shape_5d
[
1
],
# Tf
_filters_shape_5d
[
1
],
# Tf
_signals_shape_5d
[
3
]
-
_filters_shape_5d
[
3
]
+
1
,
_signals_shape_5d
[
3
]
-
_filters_shape_5d
[
3
]
+
1
,
_signals_shape_5d
[
4
]
-
_filters_shape_5d
[
4
]
+
1
,
_signals_shape_5d
[
4
]
-
_filters_shape_5d
[
4
]
+
1
,
))
))
elif
border_mode
[
1
]
==
'full'
:
elif
border_mode
[
1
]
==
'full'
:
out_tmp
=
out_4d
.
reshape
((
out_tmp
=
out_4d
.
reshape
((
_signals_shape_5d
[
0
],
# Ns
_signals_shape_5d
[
0
],
# Ns
...
@@ -237,7 +237,7 @@ def conv3d(signals, filters,
...
@@ -237,7 +237,7 @@ def conv3d(signals, filters,
_filters_shape_5d
[
1
],
# Tf
_filters_shape_5d
[
1
],
# Tf
_signals_shape_5d
[
3
]
+
_filters_shape_5d
[
3
]
-
1
,
_signals_shape_5d
[
3
]
+
_filters_shape_5d
[
3
]
-
1
,
_signals_shape_5d
[
4
]
+
_filters_shape_5d
[
4
]
-
1
,
_signals_shape_5d
[
4
]
+
_filters_shape_5d
[
4
]
-
1
,
))
))
elif
border_mode
[
1
]
==
'same'
:
elif
border_mode
[
1
]
==
'same'
:
raise
NotImplementedError
()
raise
NotImplementedError
()
else
:
else
:
...
@@ -246,15 +246,15 @@ def conv3d(signals, filters,
...
@@ -246,15 +246,15 @@ def conv3d(signals, filters,
# now sum out along the Tf to get the output
# now sum out along the Tf to get the output
# but we have to sum on a diagonal through the Tf and Ts submatrix.
# but we have to sum on a diagonal through the Tf and Ts submatrix.
if
border_mode
[
0
]
==
'valid'
:
if
border_mode
[
0
]
==
'valid'
:
if
_filters_shape_5d
[
1
]
!=
1
:
if
_filters_shape_5d
[
1
]
!=
1
:
out_5d
=
diagonal_subtensor
(
out_tmp
,
1
,
3
)
.
sum
(
axis
=
3
)
out_5d
=
diagonal_subtensor
(
out_tmp
,
1
,
3
)
.
sum
(
axis
=
3
)
else
:
# for Tf==1, no sum along Tf, the Ts-axis of the output is unchanged!
else
:
# for Tf==1, no sum along Tf, the Ts-axis of the output is unchanged!
out_5d
=
out_tmp
.
reshape
((
out_5d
=
out_tmp
.
reshape
((
_signals_shape_5d
[
0
],
_signals_shape_5d
[
0
],
_signals_shape_5d
[
1
],
_signals_shape_5d
[
1
],
_filters_shape_5d
[
0
],
_filters_shape_5d
[
0
],
_signals_shape_5d
[
3
]
-
_filters_shape_5d
[
3
]
+
1
,
_signals_shape_5d
[
3
]
-
_filters_shape_5d
[
3
]
+
1
,
_signals_shape_5d
[
4
]
-
_filters_shape_5d
[
4
]
+
1
,
_signals_shape_5d
[
4
]
-
_filters_shape_5d
[
4
]
+
1
,
))
))
elif
border_mode
[
0
]
in
(
'full'
,
'same'
):
elif
border_mode
[
0
]
in
(
'full'
,
'same'
):
raise
NotImplementedError
(
'sequence border mode'
,
border_mode
[
0
])
raise
NotImplementedError
(
'sequence border mode'
,
border_mode
[
0
])
...
@@ -316,7 +316,7 @@ if cuda.cuda_available:
...
@@ -316,7 +316,7 @@ if cuda.cuda_available:
def
local_inplace_DiagonalSubtensor
(
node
):
def
local_inplace_DiagonalSubtensor
(
node
):
""" also work for IncDiagonalSubtensor """
""" also work for IncDiagonalSubtensor """
if
(
isinstance
(
node
.
op
,
(
DiagonalSubtensor
,
IncDiagonalSubtensor
))
and
if
(
isinstance
(
node
.
op
,
(
DiagonalSubtensor
,
IncDiagonalSubtensor
))
and
not
node
.
op
.
inplace
):
not
node
.
op
.
inplace
):
new_op
=
node
.
op
.
__class__
(
inplace
=
True
)
new_op
=
node
.
op
.
__class__
(
inplace
=
True
)
new_node
=
new_op
(
*
node
.
inputs
)
new_node
=
new_op
(
*
node
.
inputs
)
return
[
new_node
]
return
[
new_node
]
...
...
theano/tests/test_flake8.py
浏览文件 @
1fef9423
...
@@ -89,7 +89,6 @@ whitelist_flake8 = [
...
@@ -89,7 +89,6 @@ whitelist_flake8 = [
"tensor/signal/tests/test_conv.py"
,
"tensor/signal/tests/test_conv.py"
,
"tensor/signal/tests/test_downsample.py"
,
"tensor/signal/tests/test_downsample.py"
,
"tensor/nnet/__init__.py"
,
"tensor/nnet/__init__.py"
,
"tensor/nnet/conv3d2d.py"
,
"tensor/nnet/conv.py"
,
"tensor/nnet/conv.py"
,
"tensor/nnet/neighbours.py"
,
"tensor/nnet/neighbours.py"
,
"tensor/nnet/tests/test_conv.py"
,
"tensor/nnet/tests/test_conv.py"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论