Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
62966940
提交
62966940
authored
2月 04, 2016
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix the docstrings in abstract_conv.py
上级
abe2d24c
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
136 行增加
和
114 行删除
+136
-114
abstract_conv.py
theano/tensor/nnet/abstract_conv.py
+136
-114
没有找到文件。
theano/tensor/nnet/abstract_conv.py
浏览文件 @
62966940
...
...
@@ -132,68 +132,80 @@ def conv2d_grad_wrt_inputs(output_grad,
used by the convolution, such that the output_grad is upsampled
to the input shape.
:type output_grad: symbolic 4D tensor.
:param output_grad: mini-batch of feature map stacks, of shape
(batch size, input channels, input rows, input columns).
This is the tensor that will be upsampled or the output
gradient of the convolution whose gradient will be taken
with respect to the input of the convolution.
See the optional parameter ``output_grad_shape``.
:type filters: symbolic 4D tensor.
:param filters: set of filters used in CNN layer of shape
(output channels, input channels, filter rows, filter columns).
See the optional parameter ``filter_shape``.
:type output_grad_shape: None, tuple/list of len 4 of int or
Constant variable.
:param output_grad_shape: The shape of the output_grad parameter.
Optional, possibly used to choose an optimal implementation.
You can give ``None`` for any element of the list to specify that this
Parameters
----------
output_grad : symbolic 4D tensor
mini-batch of feature map stacks, of shape (batch size, input
channels, input rows, input columns). This is the tensor that
will be upsampled or the output gradient of the convolution
whose gradient will be taken with respect to the input of the
convolution. See the optional parameter
``output_grad_shape``.
filters : symbolic 4D tensor
set of filters used in CNN layer of shape (output channels,
input channels, filter rows, filter columns). See the
optional parameter ``filter_shape``.
output_grad_shape : list of 4 symbolic or real ints
The shape of the output_grad parameter. Optional, possibly
used to choose an optimal implementation. You can give
``None`` for any element of the list to specify that this
element is not known at compile time.
input_shape : list of 2 symbolic or real ints
The shape (row and column size) of the input (upsampled)
parameter. Not Optional, since given the output_grad_shape
and the subsample values, multiple input_shape may be
plausible.
filter_shape : list of 4 symbolic or real ints
The shape of the filters parameter. Optional, possibly used
to choose an optimal implementation. You can give ``None``
for any element of the list to specify that this element is
not known at compile time.
border_mode : str, int or tuple of two int
Either of the following:
:type input_shape: tuple/list of len 2 of int or Constant variable.
:param input_shape: The shape (row and column size) of the
input (upsampled) parameter.
Not Optional, since given the output_grad_shape and the subsample values,
multiple input_shape may be plausible.
``'valid'``
apply filter wherever it completely overlaps with the
input. Generates output of shape: input shape - filter
shape + 1
:type filter_shape: None, tuple/list of len 4 of int or Constant variable
:param filter_shape: The shape of the filters parameter.
Optional, possibly used to choose an optimal implementation.
You can give ``None`` for any element of the list to specify that this
element is not known at compile time.
``'full'``
apply filter wherever it partly overlaps with the input.
Generates output of shape: input shape + filter shape - 1
:type border_mode: str, int or tuple of two int
:param border_mode: Either of the following:
* ``'valid'``: apply filter wherever it completely overlaps with the
input. Generates output of shape: input shape - filter shape + 1
* ``'full'``: apply filter wherever it partly overlaps with the input.
Generates output of shape: input shape + filter shape - 1
* ``'half'``: pad input with a symmetric border of ``filter rows // 2``
rows and ``filter columns // 2`` columns, then perform a valid
convolution. For filters with an odd number of rows and columns, this
leads to the output shape being equal to the input shape.
* ``int``: pad input with a symmetric border of zeros of the given
width, then perform a valid convolution.
* ``(int1, int2)``: pad input with a symmetric border of ``int1`` rows
and ``int2`` columns, then perform a valid convolution.
:type subsample: tuple of len 2, the subsampling used in the forward pass
of the convolutional operation.
:param subsample: factor by which to subsample the output.
Also called strides elsewhere.
``'half'``
pad input with a symmetric border of ``filter rows // 2``
rows and ``filter columns // 2`` columns, then perform a
valid convolution. For filters with an odd number of rows
and columns, this leads to the output shape being equal to
the input shape.
:type filter_flip: bool
:param filter_flip: If ``True``, will flip the filter rows and columns
before sliding them over the input. This operation is normally referred
to as a convolution, and this is the default. If ``False``, the filters
are not flipped and the operation is referred to as a
cross-correlation.
``int``
pad input with a symmetric border of zeros of the given
width, then perform a valid convolution.
``(int1, int2)``
pad input with a symmetric border of ``int1`` rows and
``int2`` columns, then perform a valid convolution.
subsample : tuple of len 2
The subsampling used in the forward pass. Also called strides
elsewhere.
filter_flip : bool
If ``True``, will flip the filter rows and columns before
sliding them over the input. This operation is normally
referred to as a convolution, and this is the default. If
``False``, the filters are not flipped and the operation is
referred to as a cross-correlation.
Returns
-------
symbolic 4D tensor
set of feature maps generated by convolutional layer. Tensor
is of shape (batch size, output channels, output rows, output
columns)
:rtype: symbolic 4D tensor.
:return: set of feature maps generated by convolutional layer. Tensor is
of shape (batch size, output channels, output rows, output columns)
Notes
-----
:note: If CuDNN is available, it will be used on the
GPU. Otherwise, it is the *CorrMM* convolution that will be used
...
...
@@ -224,71 +236,81 @@ def conv2d_grad_wrt_weights(input,
"""This function will build the symbolic graph for getting the
gradient of the output of a convolution (output_grad) w.r.t its wights.
:type input: symbolic 4D tensor.
:param input: mini-batch of feature map stacks, of shape
(batch size, input channels, input rows, input columns).
This is the input of the convolution in the forward pass.
Parameters
----------
input : symbolic 4D tensor
mini-batch of feature map stacks, of shape (batch size, input
channels, input rows, input columns). This is the input of
the convolution in the forward pass.
output_grad : symbolic 4D tensor
mini-batch of feature map stacks, of shape (batch size, input
channels, input rows, input columns). This is the gradient of
the output of convolution.
filters : symbolic 4D tensor.
set of filters used in CNN layer of shape (output channels,
input channels, filter rows, filter columns). See the
optional parameter ``filter_shape``.
output_grad_shape : list of 4 ints or Constant variables
The shape of the input parameter. Optional, possibly used to
choose an optimal implementation. You can give ``None`` for
any element of the list to specify that this element is not
known at compile time.
input_shape : list of 2 ints or Constant variables
The shape of the input parameter. This parameter indicates
the row and column size of the input in the forward pass.
Optional, possibly used to choose an optimal implementation.
You can give ``None`` for any element of the list to specify
that this element is not known at compile time.
filter_shape : list of 4 ints or Constant variables
The shape of the filters parameter. Not Optional, since given
the output_grad_shape and the input_shape, multiple
filter_shape may be plausible.
border_mode : str, int or tuple of two ints
Either of the following:
:type output_grad: symbolic 4D tensor.
:param output_grad: mini-batch of feature map stacks, of shap
e
(batch size, input channels, input rows, input columns).
This is the gradient of the output of convolution.
``'valid'``
apply filter wherever it completely overlaps with th
e
input. Generates output of shape: input shape - filter
shape + 1
:type filters: symbolic 4D tensor.
:param filters: set of filters used in CNN layer of shape
(output channels, input channels, filter rows, filter columns).
See the optional parameter ``filter_shape``.
``'full'``
apply filter wherever it partly overlaps with the input.
Generates output of shape: input shape + filter shape - 1
:type output_grad_shape: None, tuple/list of len 4 of int
or Constant variable.
:param output_grad_shape: The shape of the input parameter.
Optional, possibly used to choose an optimal implementation.
You can give ``None`` for any element of the list to specify that this
element is not known at compile tim
e.
``'half'``
pad input with a symmetric border of ``filter rows // 2``
rows and ``filter columns // 2`` columns, then perform a
valid convolution. For filters with an odd number of rows
and columns, this leads to the output shape being equal to
the input shap
e.
:type input_shape: tuple/list of len 2 of int or Constant variable.
:param input_shape: The shape of the input parameter.
This parameter indicates the row and column size of the input
in the forward pass.
Optional, possibly used to choose an optimal implementation.
You can give ``None`` for any element of the list to specify that this
element is not known at compile time.
``int``
pad input with a symmetric border of zeros of the given
width, then perform a valid convolution.
:type filter_shape: None, tuple/list of len 4 of int or Constant variable.
:param filter_shape: The shape of the filters parameter.
Not Optional, since given the output_grad_shape and the input_shape,
multiple filter_shape may be plausible.
:type border_mode: str, int or tuple of two int
:param border_mode: Either of the following:
* ``'valid'``: apply filter wherever it completely overlaps with the
input. Generates output of shape: input shape - filter shape + 1
* ``'full'``: apply filter wherever it partly overlaps with the input.
Generates output of shape: input shape + filter shape - 1
* ``'half'``: pad input with a symmetric border of ``filter rows // 2``
rows and ``filter columns // 2`` columns, then perform a valid
convolution. For filters with an odd number of rows and columns, this
leads to the output shape being equal to the input shape.
* ``int``: pad input with a symmetric border of zeros of the given
width, then perform a valid convolution.
* ``(int1, int2)``: pad input with a symmetric border of ``int1`` rows
and ``int2`` columns, then perform a valid convolution.
:type subsample: tuple of len 2, the subsampling used in the forward pass
of the convolutional operation.
:param subsample: factor by which to subsample the output.
Also called strides elsewhere.
``(int1, int2)``
pad input with a symmetric border of ``int1`` rows and
``int2`` columns, then perform a valid convolution.
:type filter_flip: bool
:param filter_flip: If ``True``, will flip the filter rows and columns
before sliding them over the input. This operation is normally referred
to as a convolution, and this is the default. If ``False``, the filters
are not flipped and the operation is referred to as a
cross-correlation.
subsample : tuple of len 2
The subsampling used in the forward pass of the convolutional
operation. Also called strides elsewhere.
filter_flip : bool
If ``True``, will flip the filter rows and columns before
sliding them over the input. This operation is normally
referred to as a convolution, and this is the default. If
``False``, the filters are not flipped and the operation is
referred to as a cross-correlation.
Returns
-------
symbolic 4D tensor
set of feature maps generated by convolutional layer. Tensor
is of shape (batch size, output channels, output rows, output
columns)
:rtype: symbolic 4D tensor.
:return: set of feature maps generated by convolutional layer. Tensor is
of shape (batch size, output channels, output rows, output columns)
Notes
-----
:note: If CuDNN is available, it will be used on the
GPU. Otherwise, it is the *CorrMM* convolution that will be used
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论