Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
0d7d09a1
提交
0d7d09a1
authored
5月 31, 2017
作者:
affanv14
提交者:
Mohammed Affan
6月 14, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change get_conv_grad* functions to support num_groups
上级
0b32b7e3
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
12 行增加
和
2 行删除
+12
-2
abstract_conv.py
theano/tensor/nnet/abstract_conv.py
+12
-2
没有找到文件。
theano/tensor/nnet/abstract_conv.py
浏览文件 @
0d7d09a1
...
@@ -138,7 +138,8 @@ def get_conv_shape_1axis(image_shape, kernel_shape, border_mode,
...
@@ -138,7 +138,8 @@ def get_conv_shape_1axis(image_shape, kernel_shape, border_mode,
def
get_conv_gradweights_shape
(
image_shape
,
top_shape
,
def
get_conv_gradweights_shape
(
image_shape
,
top_shape
,
border_mode
,
subsample
,
border_mode
,
subsample
,
filter_dilation
=
None
):
filter_dilation
=
None
,
num_groups
=
1
):
"""
"""
This function tries to compute the kernel shape of convolution gradWeights.
This function tries to compute the kernel shape of convolution gradWeights.
...
@@ -166,6 +167,8 @@ def get_conv_gradweights_shape(image_shape, top_shape,
...
@@ -166,6 +167,8 @@ def get_conv_gradweights_shape(image_shape, top_shape,
filter_dilation: tuple of int (symbolic or numeric). Its two or three
filter_dilation: tuple of int (symbolic or numeric). Its two or three
elements correspond respectively to the dilation on height and
elements correspond respectively to the dilation on height and
width axis.
width axis.
num_groups: An int which specifies the number of separate groups to
be divided into.
Returns
Returns
-------
-------
...
@@ -180,6 +183,8 @@ def get_conv_gradweights_shape(image_shape, top_shape,
...
@@ -180,6 +183,8 @@ def get_conv_gradweights_shape(image_shape, top_shape,
if
filter_dilation
is
None
:
if
filter_dilation
is
None
:
filter_dilation
=
np
.
ones
(
len
(
subsample
),
dtype
=
'int'
)
filter_dilation
=
np
.
ones
(
len
(
subsample
),
dtype
=
'int'
)
if
num_groups
>
1
and
len
(
subsample
)
==
2
:
nchan
=
nchan
//
num_groups
if
isinstance
(
border_mode
,
tuple
):
if
isinstance
(
border_mode
,
tuple
):
out_shp
=
tuple
(
get_conv_gradweights_shape_1axis
(
out_shp
=
tuple
(
get_conv_gradweights_shape_1axis
(
...
@@ -244,7 +249,8 @@ def get_conv_gradweights_shape_1axis(image_shape, top_shape, border_mode,
...
@@ -244,7 +249,8 @@ def get_conv_gradweights_shape_1axis(image_shape, top_shape, border_mode,
def
get_conv_gradinputs_shape
(
kernel_shape
,
top_shape
,
def
get_conv_gradinputs_shape
(
kernel_shape
,
top_shape
,
border_mode
,
subsample
,
border_mode
,
subsample
,
filter_dilation
=
None
):
filter_dilation
=
None
,
num_groups
=
1
):
"""
"""
This function tries to compute the image shape of convolution gradInputs.
This function tries to compute the image shape of convolution gradInputs.
...
@@ -272,6 +278,8 @@ def get_conv_gradinputs_shape(kernel_shape, top_shape,
...
@@ -272,6 +278,8 @@ def get_conv_gradinputs_shape(kernel_shape, top_shape,
filter_dilation: tuple of int (symbolic or numeric). Its two or three
filter_dilation: tuple of int (symbolic or numeric). Its two or three
elements correspond respectively to the dilation on height and
elements correspond respectively to the dilation on height and
width axis.
width axis.
num_groups: An int which specifies the number of separate groups to
be divided into.
Returns
Returns
-------
-------
...
@@ -285,6 +293,8 @@ def get_conv_gradinputs_shape(kernel_shape, top_shape,
...
@@ -285,6 +293,8 @@ def get_conv_gradinputs_shape(kernel_shape, top_shape,
if
filter_dilation
is
None
:
if
filter_dilation
is
None
:
filter_dilation
=
np
.
ones
(
len
(
subsample
),
dtype
=
'int'
)
filter_dilation
=
np
.
ones
(
len
(
subsample
),
dtype
=
'int'
)
if
num_groups
>
1
and
len
(
subsample
)
==
2
:
nkern
=
nkern
*
num_groups
if
isinstance
(
border_mode
,
tuple
):
if
isinstance
(
border_mode
,
tuple
):
out_shp
=
tuple
(
get_conv_gradinputs_shape_1axis
(
out_shp
=
tuple
(
get_conv_gradinputs_shape_1axis
(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论