Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4f84063c
提交
4f84063c
authored
8月 21, 2017
作者:
Vikram
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Better documentation. Check for length of filter in conv2d_grad_wrt_inputs
上级
4a555f19
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
34 行增加
和
19 行删除
+34
-19
__init__.py
theano/tensor/nnet/__init__.py
+3
-2
abstract_conv.py
theano/tensor/nnet/abstract_conv.py
+25
-15
corr.py
theano/tensor/nnet/corr.py
+6
-2
没有找到文件。
theano/tensor/nnet/__init__.py
浏览文件 @
4f84063c
...
...
@@ -111,7 +111,7 @@ def conv2d(input, filters, input_shape=None, filter_shape=None,
unshared: bool
If true, then unshared or 'locally connected' convolution will be
performed. A different
kernel
will be used for each region of the
performed. A different
filter
will be used for each region of the
input.
kwargs: Any other keyword arguments are accepted for backwards
...
...
@@ -226,8 +226,9 @@ def conv2d_transpose(input, filters, output_shape, filter_shape=None,
unshared: bool
If true, then unshared or 'locally connected' convolution will be
performed. A different
kernel
will be used for each region of the
performed. A different
filter
will be used for each region of the
input.
Grouped unshared convolution is supported.
Returns
-------
...
...
theano/tensor/nnet/abstract_conv.py
浏览文件 @
4f84063c
...
...
@@ -44,12 +44,13 @@ def get_conv_output_shape(image_shape, kernel_shape,
to: batch size, number of input channels, height and width (and
possibly depth) of the image. None where undefined.
kernel_shape: tuple of int (symbolic or numeric) corresponding to the
kernel shape. For a normal convolution, its four (or five) elements
must correspond respectively to : number of output channels, number of
input channels, height and width (and possibly depth) of the kernel.
For an unshared convolution, its six channels must correspond to :
number of output channels, height and width
of the output, number of input channels, height and width of the kernel.
kernel shape. For a normal convolution, its four (for 2D convolution)
or five (for 3D convolution) elements must correspond respectively to :
number of output channels, number of input channels, height and width
(and possibly depth) of the kernel.
For an unshared 2D convolution, its six channels must correspond to :
number of output channels, height and width of the output, number of
input channels, height and width of the kernel.
None where undefined.
border_mode: string, int (symbolic or numeric) or tuple of int (symbolic
or numeric). If it is a string, it must be 'valid', 'half' or 'full'.
...
...
@@ -996,7 +997,7 @@ def conv2d_grad_wrt_inputs(output_grad,
separate groups. Each which carry out convolutions separately
unshared: bool
If true, then unshared or 'locally connected' convolution will be
performed. A different
kernel
will be used for each region of the
performed. A different
filter
will be used for each region of the
input.
Returns
...
...
@@ -1032,13 +1033,16 @@ def conv2d_grad_wrt_inputs(output_grad,
# checking the type of filter_shape
if
filter_shape
is
not
None
:
for
dim
in
[
0
,
1
,
2
,
3
]:
if
unshared
:
expected_dim
=
6
else
:
expected_dim
=
4
assert
len
(
filter_shape
)
==
expected_dim
for
dim
in
range
(
expected_dim
):
assert
isinstance
(
filter_shape
[
dim
],
(
theano
.
tensor
.
TensorConstant
,
integer_types
,
type
(
None
)))
if
unshared
:
for
dim
in
[
4
,
5
]:
assert
isinstance
(
filter_shape
[
dim
],
(
theano
.
tensor
.
TensorConstant
,
integer_types
,
type
(
None
)))
# setting the last two dimensions of input_shape to None, if
# the type of these dimensions is TensorVariable.
...
...
@@ -1278,7 +1282,7 @@ def conv2d_grad_wrt_weights(input,
separate groups. Each which carry out convolutions separately
unshared: bool
If true, then unshared or 'locally connected' convolution will be
performed. A different
kernel
will be used for each region of the
performed. A different
filter
will be used for each region of the
input.
Returns
...
...
@@ -1712,9 +1716,13 @@ class BaseAbstractConv(Op):
Factor by which to subsample (stride) the input.
Also called dilation factor.
num_groups : int
Divides the image, kernel and output tensors into num_groups
separate groups. Each which carry out convolutions separately
unshared: bool
If true, then unshared or 'locally connected' convolution will be
performed. A different
kernel
will be used for each region of the
performed. A different
filter
will be used for each region of the
input.
"""
check_broadcast
=
False
...
...
@@ -1843,7 +1851,9 @@ class BaseAbstractConv(Op):
if
unshared
and
direction
==
"backprop weights"
:
if
mode
!=
"valid"
:
raise
ValueError
(
'conv mode for unshared backprop wrt weights must be "valid"'
)
# Do a transpose later to bring it to required shape
# To allow the same format for the call to 'unshared2d' for all three directions,
# the out_shape is shuffled here.
# We do a transpose in the 'perform' function to bring it to the required shape
out_shape
=
(
img
.
shape
[
0
],
kern
.
shape
[
0
],
kern
.
shape
[
2
],
kern
.
shape
[
3
],
img
.
shape
[
2
]
-
kern
.
shape
[
2
]
+
1
,
...
...
theano/tensor/nnet/corr.py
浏览文件 @
4f84063c
...
...
@@ -600,8 +600,12 @@ class CorrMM(BaseCorrMM):
The filter dilation operation applied to each input image.
Should be a tuple with 2 elements.
Set to `(1, 1)` to disable filter dilation.
unshared:
Boolean value. If true, then a different kernel will be applied to
num_groups
Divides the image, kernel and output tensors into num_groups
separate groups. Each which carry out convolutions separately.
Should be an integer.
unshared
Boolean value. If true, then a different filter will be applied to
each region of the input image.
"""
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论