提交 658ba1ce authored 作者: Sina Honari's avatar Sina Honari

further refining the comments

上级 7b8ee75b
...@@ -191,29 +191,29 @@ def conv2d_grad_wrt_inputs(output_grad, ...@@ -191,29 +191,29 @@ def conv2d_grad_wrt_inputs(output_grad,
used by the convolution, such that the output_grad is upsampled used by the convolution, such that the output_grad is upsampled
to the input shape. to the input shape.
:type output_grad: symbolic 4D tensor as the output gradient :type output_grad: symbolic 4D tensor.
of the convolution. This is the tensor that will be upsampled
or whose gradient will be taken with respect to the input of
the convolution.
:param output_grad: mini-batch of feature map stacks, of shape :param output_grad: mini-batch of feature map stacks, of shape
(batch size, input channels, input rows, input columns). (batch size, input channels, input rows, input columns).
See the optional parameter ``input_shape``. 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 :type filters: symbolic 4D tensor.
:param filters: set of filters used in CNN layer of shape :param filters: set of filters used in CNN layer of shape
(output channels, input channels, filter rows, filter columns). (output channels, input channels, filter rows, filter columns).
See the optional parameter ``filter_shape``. See the optional parameter ``filter_shape``.
:type output_grad_shape: None, tuple/list of len 4 of int or :type output_grad_shape: None, tuple/list of len 4 of int or
Constant variable indicating the shape of the output_grad. Constant variable.
:param output_grad_shape: The shape of the output_grad parameter. :param output_grad_shape: The shape of the output_grad parameter.
Optional, possibly used to choose an optimal implementation. Optional, possibly used to choose an optimal implementation.
You can give ``None`` for any element of the list to specify that this You can give ``None`` for any element of the list to specify that this
element is not known at compile time. element is not known at compile time.
:type input_shape: tuple/list of len 2 of int or Constant variable :type input_shape: tuple/list of len 2 of int or Constant variable.
indicating the row and column size of the input (upsampled) features. :param input_shape: The shape (row and column size) of the
:param input_shape: The shape of the input parameter. input (upsampled) parameter.
Not Optional, since given the output_grad_shape and the subsample values, Not Optional, since given the output_grad_shape and the subsample values,
multiple input_shape may be plausible. multiple input_shape may be plausible.
...@@ -250,7 +250,7 @@ def conv2d_grad_wrt_inputs(output_grad, ...@@ -250,7 +250,7 @@ def conv2d_grad_wrt_inputs(output_grad,
are not flipped and the operation is referred to as a are not flipped and the operation is referred to as a
cross-correlation. cross-correlation.
:rtype: symbolic 4D tensor :rtype: symbolic 4D tensor.
:return: set of feature maps generated by convolutional layer. Tensor is :return: set of feature maps generated by convolutional layer. Tensor is
of shape (batch size, output channels, output rows, output columns) of shape (batch size, output channels, output rows, output columns)
...@@ -283,35 +283,37 @@ def conv2d_grad_wrt_weights(input, ...@@ -283,35 +283,37 @@ def conv2d_grad_wrt_weights(input,
"""This function will build the symbolic graph for getting the """This function will build the symbolic graph for getting the
gradient of the output of a convolution (output_grad) w.r.t its wights. gradient of the output of a convolution (output_grad) w.r.t its wights.
:type input: symbolic 4D tensor as the input of the convolution :type input: symbolic 4D tensor.
in the forward pass
:param input: mini-batch of feature map stacks, of shape :param input: mini-batch of feature map stacks, of shape
(batch size, input channels, input rows, input columns). (batch size, input channels, input rows, input columns).
This is the input of the convolution in the forward pass.
:type output_grad: symbolic 4D tensor as the gradient output :type output_grad: symbolic 4D tensor.
of the convolution
:param output_grad: mini-batch of feature map stacks, of shape :param output_grad: mini-batch of feature map stacks, of shape
(batch size, input channels, input rows, input columns). (batch size, input channels, input rows, input columns).
This is the gradient of the output of convolution.
:type filters: symbolic 4D tensor :type filters: symbolic 4D tensor.
:param filters: set of filters used in CNN layer of shape :param filters: set of filters used in CNN layer of shape
(output channels, input channels, filter rows, filter columns). (output channels, input channels, filter rows, filter columns).
See the optional parameter ``filter_shape``. See the optional parameter ``filter_shape``.
:type output_grad_shape: None, tuple/list of len 4 of int or Constant variable :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. :param output_grad_shape: The shape of the input parameter.
Optional, possibly used to choose an optimal implementation. Optional, possibly used to choose an optimal implementation.
You can give ``None`` for any element of the list to specify that this You can give ``None`` for any element of the list to specify that this
element is not known at compile time. element is not known at compile time.
:type input_shape: tuple/list of len 2 of int or Constant variable :type input_shape: tuple/list of len 2 of int or Constant variable.
indicating the row and column size of the input in the forward pass.
:param input_shape: The shape of the input parameter. :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. Optional, possibly used to choose an optimal implementation.
You can give ``None`` for any element of the list to specify that this You can give ``None`` for any element of the list to specify that this
element is not known at compile time. element is not known at compile time.
:type filter_shape: None, tuple/list of len 4 of int or Constant variable :type filter_shape: None, tuple/list of len 4 of int or Constant variable.
:param filter_shape: The shape of the filters parameter. :param filter_shape: The shape of the filters parameter.
Not Optional, since given the output_grad_shape and the input_shape, Not Optional, since given the output_grad_shape and the input_shape,
multiple filter_shape may be plausible. multiple filter_shape may be plausible.
...@@ -343,7 +345,7 @@ def conv2d_grad_wrt_weights(input, ...@@ -343,7 +345,7 @@ def conv2d_grad_wrt_weights(input,
are not flipped and the operation is referred to as a are not flipped and the operation is referred to as a
cross-correlation. cross-correlation.
:rtype: symbolic 4D tensor :rtype: symbolic 4D tensor.
:return: set of feature maps generated by convolutional layer. Tensor is :return: set of feature maps generated by convolutional layer. Tensor is
of shape (batch size, output channels, output rows, output columns) of shape (batch size, output channels, output rows, output columns)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论