Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
2ce0646e
提交
2ce0646e
authored
2月 24, 2017
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Explicitly specify the output ndim in reshape
The whole code expects the shape to be of length 4, and the output to be 4D already
上级
bcf2d7dc
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
2 行增加
和
2 行删除
+2
-2
neighbours.py
theano/tensor/nnet/neighbours.py
+2
-2
没有找到文件。
theano/tensor/nnet/neighbours.py
浏览文件 @
2ce0646e
...
@@ -620,7 +620,7 @@ def neibs2images(neibs, neib_shape, original_shape, mode='valid'):
...
@@ -620,7 +620,7 @@ def neibs2images(neibs, neib_shape, original_shape, mode='valid'):
valid_shape
=
list
(
original_shape
)
valid_shape
=
list
(
original_shape
)
valid_shape
[
2
]
=
(
valid_shape
[
2
]
//
neib_shape
[
0
])
*
neib_shape
[
0
]
valid_shape
[
2
]
=
(
valid_shape
[
2
]
//
neib_shape
[
0
])
*
neib_shape
[
0
]
valid_shape
[
3
]
=
(
valid_shape
[
3
]
//
neib_shape
[
1
])
*
neib_shape
[
1
]
valid_shape
[
3
]
=
(
valid_shape
[
3
]
//
neib_shape
[
1
])
*
neib_shape
[
1
]
output_4d
=
output_2d
.
reshape
(
valid_shape
)
output_4d
=
output_2d
.
reshape
(
valid_shape
,
ndim
=
4
)
# padding the borders with zeros
# padding the borders with zeros
for
d
in
[
2
,
3
]:
for
d
in
[
2
,
3
]:
pad_shape
=
list
(
output_4d
.
shape
)
pad_shape
=
list
(
output_4d
.
shape
)
...
@@ -629,7 +629,7 @@ def neibs2images(neibs, neib_shape, original_shape, mode='valid'):
...
@@ -629,7 +629,7 @@ def neibs2images(neibs, neib_shape, original_shape, mode='valid'):
elif
mode
==
'valid'
:
elif
mode
==
'valid'
:
# TODO: we do not implement all mode with this code.
# TODO: we do not implement all mode with this code.
# Add a check for the good cases.
# Add a check for the good cases.
output_4d
=
output_2d
.
reshape
(
original_shape
)
output_4d
=
output_2d
.
reshape
(
original_shape
,
ndim
=
4
)
else
:
else
:
raise
NotImplementedError
(
"neibs2images do not support mode=
%
s"
%
mode
)
raise
NotImplementedError
(
"neibs2images do not support mode=
%
s"
%
mode
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论