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 个修改的文件
包含
33 行增加
和
18 行删除
+33
-18
__init__.py
theano/tensor/nnet/__init__.py
+3
-2
abstract_conv.py
theano/tensor/nnet/abstract_conv.py
+24
-14
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,
...
@@ -111,7 +111,7 @@ def conv2d(input, filters, input_shape=None, filter_shape=None,
unshared: bool
unshared: bool
If true, then unshared or 'locally connected' convolution will be
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.
input.
kwargs: Any other keyword arguments are accepted for backwards
kwargs: Any other keyword arguments are accepted for backwards
...
@@ -226,8 +226,9 @@ def conv2d_transpose(input, filters, output_shape, filter_shape=None,
...
@@ -226,8 +226,9 @@ def conv2d_transpose(input, filters, output_shape, filter_shape=None,
unshared: bool
unshared: bool
If true, then unshared or 'locally connected' convolution will be
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.
input.
Grouped unshared convolution is supported.
Returns
Returns
-------
-------
...
...
theano/tensor/nnet/abstract_conv.py
浏览文件 @
4f84063c
...
@@ -44,12 +44,13 @@ def get_conv_output_shape(image_shape, kernel_shape,
...
@@ -44,12 +44,13 @@ def get_conv_output_shape(image_shape, kernel_shape,
to: batch size, number of input channels, height and width (and
to: batch size, number of input channels, height and width (and
possibly depth) of the image. None where undefined.
possibly depth) of the image. None where undefined.
kernel_shape: tuple of int (symbolic or numeric) corresponding to the
kernel_shape: tuple of int (symbolic or numeric) corresponding to the
kernel shape. For a normal convolution, its four (or five) elements
kernel shape. For a normal convolution, its four (for 2D convolution)
must correspond respectively to : number of output channels, number of
or five (for 3D convolution) elements must correspond respectively to :
input channels, height and width (and possibly depth) of the kernel.
number of output channels, number of input channels, height and width
For an unshared convolution, its six channels must correspond to :
(and possibly depth) of the kernel.
number of output channels, height and width
For an unshared 2D convolution, its six channels must correspond to :
of the output, number of input channels, height and width of the kernel.
number of output channels, height and width of the output, number of
input channels, height and width of the kernel.
None where undefined.
None where undefined.
border_mode: string, int (symbolic or numeric) or tuple of int (symbolic
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'.
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,
...
@@ -996,7 +997,7 @@ def conv2d_grad_wrt_inputs(output_grad,
separate groups. Each which carry out convolutions separately
separate groups. Each which carry out convolutions separately
unshared: bool
unshared: bool
If true, then unshared or 'locally connected' convolution will be
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.
input.
Returns
Returns
...
@@ -1032,11 +1033,14 @@ def conv2d_grad_wrt_inputs(output_grad,
...
@@ -1032,11 +1033,14 @@ def conv2d_grad_wrt_inputs(output_grad,
# checking the type of filter_shape
# checking the type of filter_shape
if
filter_shape
is
not
None
:
if
filter_shape
is
not
None
:
for
dim
in
[
0
,
1
,
2
,
3
]:
assert
isinstance
(
filter_shape
[
dim
],
(
theano
.
tensor
.
TensorConstant
,
integer_types
,
type
(
None
)))
if
unshared
:
if
unshared
:
for
dim
in
[
4
,
5
]:
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
,
assert
isinstance
(
filter_shape
[
dim
],
(
theano
.
tensor
.
TensorConstant
,
integer_types
,
type
(
None
)))
integer_types
,
type
(
None
)))
...
@@ -1278,7 +1282,7 @@ def conv2d_grad_wrt_weights(input,
...
@@ -1278,7 +1282,7 @@ def conv2d_grad_wrt_weights(input,
separate groups. Each which carry out convolutions separately
separate groups. Each which carry out convolutions separately
unshared: bool
unshared: bool
If true, then unshared or 'locally connected' convolution will be
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.
input.
Returns
Returns
...
@@ -1712,9 +1716,13 @@ class BaseAbstractConv(Op):
...
@@ -1712,9 +1716,13 @@ class BaseAbstractConv(Op):
Factor by which to subsample (stride) the input.
Factor by which to subsample (stride) the input.
Also called dilation factor.
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
unshared: bool
If true, then unshared or 'locally connected' convolution will be
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.
input.
"""
"""
check_broadcast
=
False
check_broadcast
=
False
...
@@ -1843,7 +1851,9 @@ class BaseAbstractConv(Op):
...
@@ -1843,7 +1851,9 @@ class BaseAbstractConv(Op):
if
unshared
and
direction
==
"backprop weights"
:
if
unshared
and
direction
==
"backprop weights"
:
if
mode
!=
"valid"
:
if
mode
!=
"valid"
:
raise
ValueError
(
'conv mode for unshared backprop wrt weights must be "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
],
out_shape
=
(
img
.
shape
[
0
],
kern
.
shape
[
0
],
kern
.
shape
[
2
],
kern
.
shape
[
3
],
kern
.
shape
[
2
],
kern
.
shape
[
3
],
img
.
shape
[
2
]
-
kern
.
shape
[
2
]
+
1
,
img
.
shape
[
2
]
-
kern
.
shape
[
2
]
+
1
,
...
...
theano/tensor/nnet/corr.py
浏览文件 @
4f84063c
...
@@ -600,8 +600,12 @@ class CorrMM(BaseCorrMM):
...
@@ -600,8 +600,12 @@ class CorrMM(BaseCorrMM):
The filter dilation operation applied to each input image.
The filter dilation operation applied to each input image.
Should be a tuple with 2 elements.
Should be a tuple with 2 elements.
Set to `(1, 1)` to disable filter dilation.
Set to `(1, 1)` to disable filter dilation.
unshared:
num_groups
Boolean value. If true, then a different kernel will be applied to
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.
each region of the input image.
"""
"""
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论