提交 90c8f80b authored 作者: Nicolas Ballas's avatar Nicolas Ballas

update doc

上级 77729ffa
......@@ -31,11 +31,15 @@
that will be replaced by an actual convolution implementation during
the optimization phase.
Since the abstract Op does not have any implementation, it will prevent
computations in the un-optimized graph, and cause problems with DebugMode,
test values, and when compiling with optimizer=None.
By default, if :ref:`cuDNN <libdoc_cuda_dnn>`
is available, we will use it, otherwise we will fall back to using the
gemm version (slower then cuDNN in most cases and uses more memory).
Both cuDNN and the gemm version can be disabled using the Theano flags
Either cuDNN and the gemm version can be disabled using the Theano flags
``optimizer_excluding=conv_dnn`` and ``optimizer_excluding=conv_gemm``,
respectively. In this case, we will fall back to using the legacy
convolution code, which is slower, but does not require extra memory.
......
......@@ -43,30 +43,33 @@ def conv2d(input, filters, input_shape=None, filter_shape=None,
stack of 2D inputs with a set of 2D filters. The implementation is modelled
after Convolutional Neural Networks (CNN).
:type input: symbolic 4D tensor
:param input: mini-batch of feature map stacks, of shape
Parameters
----------
input: symbolic 4D tensor
Mini-batch of feature map stacks, of shape
(batch size, input channels, input rows, input columns).
See the optional parameter ``input_shape``.
:type filters: symbolic 4D tensor
:param filters: set of filters used in CNN layer of 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``.
:type input_shape: None, tuple/list of len 4 of int or Constant variable
:param input_shape: The shape of the input parameter.
input_shape: None, tuple/list of len 4 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.
:type filter_shape: None, tuple/list of len 4 of int or Constant variable
:param filter_shape: The shape of the filters parameter.
filter_shape: None, tuple/list of len 4 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.
:type border_mode: str, int or tuple of two int
:param border_mode: Either of the following:
border_mode: str, int or tuple of two int
Either of the following:
``'valid'``: apply filter wherever it completely overlaps with the
input. Generates output of shape: input shape - filter shape + 1
......@@ -81,31 +84,35 @@ def conv2d(input, filters, input_shape=None, filter_shape=None,
``(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
:param subsample: factor by which to subsample the output.
subsample: tuple of len 2
Factor by which to subsample the output.
Also called strides elsewhere.
:type filter_flip: bool
:param filter_flip: If ``True``, will flip the filter rows and columns
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.
:type image_shape: None, tuple/list of len 4 of int or Constant variable
:param image_shape: Deprecated alias for input_shape.
image_shape: None, tuple/list of len 4 of int or Constant variable
Deprecated alias for input_shape.
:param kwargs: Any other keyword arguments are accepted for backwards
compatibility, but will be ignored.
kwargs: Any other keyword arguments are accepted for backwards
compatibility, but will be ignored.
:rtype: symbolic 4D tensor
:return: set of feature maps generated by convolutional layer. Tensor is
Returns
-------
Symbolic 4D tensor
Set of feature maps generated by convolutional layer. Tensor is
of shape (batch size, output channels, output rows, output columns)
:note: If CuDNN is available, it will be used on the
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".
:note: This is only supported in Theano 0.8 or the development
This is only supported in Theano 0.8 or the development
version until it is released.
"""
......
......@@ -124,22 +124,24 @@ class BaseAbstractConv2d(Op):
Define an abstract convolution op that will be replaced with the
appropriate implementation
:type imshp: None, tuple/list of len 4 of int or Constant variable
:param imshp: The shape of the input parameter.
Parameters
----------
imshp: None, tuple/list of len 4 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.
imshp is defined w.r.t the forward conv.
:type kshp: None, tuple/list of len 4 of int or Constant variable
:param kshp: The shape of the filters parameter.
kshp: None, tuple/list of len 4 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.
kshp is defined w.r.t the forward conv.
:type border_mode: str, int or tuple of two int
:param border_mode: Either of the following:
border_mode: str, int or tuple of two int
Either of the following:
``'valid'``: apply filter wherever it completely overlaps with the
input. Generates output of shape: input shape - filter shape + 1
......@@ -154,12 +156,12 @@ class BaseAbstractConv2d(Op):
``(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
:param subsample: factor by which to subsample the output.
subsample: tuple of len 2
Factor by which to subsample the output.
Also called strides elsewhere.
:type filter_flip: bool
:param filter_flip: If ``True``, will flip the filter rows and columns
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
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论