Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
99cca895
提交
99cca895
authored
8月 19, 2016
作者:
Gijs van Tulder
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add theano.nnet.conv3d helper function.
上级
44bb7df0
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
117 行增加
和
0 行删除
+117
-0
__init__.py
theano/tensor/nnet/__init__.py
+117
-0
没有找到文件。
theano/tensor/nnet/__init__.py
浏览文件 @
99cca895
...
@@ -151,3 +151,120 @@ def conv2d(input, filters, input_shape=None, filter_shape=None,
...
@@ -151,3 +151,120 @@ def conv2d(input, filters, input_shape=None, filter_shape=None,
return
abstract_conv2d
(
input
,
filters
,
input_shape
,
filter_shape
,
return
abstract_conv2d
(
input
,
filters
,
input_shape
,
filter_shape
,
border_mode
,
subsample
,
filter_flip
,
border_mode
,
subsample
,
filter_flip
,
filter_dilation
)
filter_dilation
)
def
conv3d
(
input
,
filters
,
input_shape
=
None
,
filter_shape
=
None
,
border_mode
=
'valid'
,
subsample
=
(
1
,
1
,
1
),
filter_flip
=
True
,
image_shape
=
None
,
filter_dilation
=
(
1
,
1
,
1
),
**
kwargs
):
"""
This function will build the symbolic graph for convolving a mini-batch of a
stack of 3D inputs with a set of 3D filters. The implementation is modelled
after Convolutional Neural Networks (CNN).
Parameters
----------
input: symbolic 5D tensor
Mini-batch of feature map stacks, of shape
(batch size, input channels, input depth, input rows, input columns).
See the optional parameter ``input_shape``.
filters: symbolic 5D tensor
Set of filters used in CNN layer of shape
(output channels, input channels, filter depth, filter rows, filter columns).
See the optional parameter ``filter_shape``.
input_shape: None, tuple/list of len 5 of int or Constant variable
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.
filter_shape: None, tuple/list of len 5 of int or Constant variable
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 three int
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 // 2``,
then perform a valid convolution. For filters with an odd
number of slices, 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, int3)``
pad input with a symmetric border of ``int1``, ``int2`` and
``int3`` columns, then perform a valid convolution.
subsample: tuple of len 3
Factor by which to subsample the output.
Also called strides elsewhere.
filter_flip: bool
If ``True``, will flip the filter x, y and z dimensions 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.
image_shape: None, tuple/list of len 5 of int or Constant variable
Deprecated alias for input_shape.
filter_dilation: tuple of len 3
Factor by which to subsample (stride) the input.
Also called dilation elsewhere.
kwargs: Any other keyword arguments are accepted for backwards
compatibility, but will be ignored.
Returns
-------
Symbolic 5D tensor
Set of feature maps generated by convolutional layer. Tensor is
is of shape (batch size, output channels, output depth,
output rows, output columns)
Notes
-----
If cuDNN is available, it will be used on the
GPU. Otherwise, it is the *CorrMM* convolution that will be used
"caffe style convolution".
This is only supported in Theano 0.8 or the development
version until it is released.
"""
if
'imshp_logical'
in
kwargs
or
'kshp_logical'
in
kwargs
:
raise
ValueError
(
"Keyword arguments 'imshp_logical' and 'kshp_logical' for conv3d "
"are not supported anymore (and have not been a reliable way to "
"perform upsampling)."
)
if
len
(
kwargs
.
keys
())
>
0
:
warnings
.
warn
(
str
(
kwargs
.
keys
())
+
" are now deprecated in "
"`tensor.nnet.abstract_conv.conv3d` interface"
" and will be ignored."
,
stacklevel
=
2
)
if
image_shape
is
not
None
:
warnings
.
warn
(
"The `image_shape` keyword argument to "
"`tensor.nnet.conv3d` is deprecated, it has been "
"renamed to `input_shape`."
,
stacklevel
=
2
)
if
input_shape
is
None
:
input_shape
=
image_shape
else
:
raise
ValueError
(
"input_shape and image_shape should not"
" be provided at the same time."
)
return
abstract_conv3d
(
input
,
filters
,
input_shape
,
filter_shape
,
border_mode
,
subsample
,
filter_flip
,
filter_dilation
)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论