From d5df50bd520797959dcd734b0729f4b54ced9883 Mon Sep 17 00:00:00 2001 From: Wang Jiajun Date: Thu, 17 Oct 2019 16:56:25 +0800 Subject: [PATCH] fix doc --- src/operator/nn/im2col.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/operator/nn/im2col.cc b/src/operator/nn/im2col.cc index a13dcc803446..4aa4eaaf77d0 100644 --- a/src/operator/nn/im2col.cc +++ b/src/operator/nn/im2col.cc @@ -84,11 +84,11 @@ void SlidingParser(nnvm::NodeAttrs* attrs) { NNVM_REGISTER_OP(im2col) .describe(R"(Extract sliding blocks from input array. -Im2col is used in vanilla convolution implementation to transform the sliding +This operator is used in vanilla convolution implementation to transform the sliding blocks on image to column matrix, then the convolution operation can be computed by matrix multiplication between column and convolution weight. Due to the close -relation between im2col and convolution, the concept of ``kernel``, ``stride``, -``dilate`` and ``pad`` in this operator are inherited from convolution operation. +relation between im2col and convolution, the concept of **kernel**, **stride**, +**dilate** and **pad** in this operator are inherited from convolution operation. Given the input data of shape :math:`(N, C, *)`, where :math:`N` is the batch size, :math:`C` is the channel size, and :math:`*` is the arbitrary spatial dimension, @@ -164,15 +164,15 @@ NNVM_REGISTER_OP(_backward_im2col) NNVM_REGISTER_OP(col2im) .describe(R"(Combining the output column matrix of im2col back to image array. -Like :class:`.im2col`, the col2im is also used in the vanilla convolution implementation. -Despite the name, col2im is not the reverse operation of im2col. Since there may be -overlaps between neighbouring sliding blocks, the column elements cannot be directly +Like :class:`~mxnet.ndarray.im2col`, this operator is also used in the vanilla convolution +implementation. Despite the name, col2im is not the reverse operation of im2col. Since there +may be overlaps between neighbouring sliding blocks, the column elements cannot be directly put back into image. Instead, they are accumulated (i.e., summed) in the input image just like the gradient computation, so col2im is the gradient of im2col and vice versa. Using the notation in im2col, given an input column array of shape :math:`(N, C \times \prod(\text{kernel}), W)`, this operator accumulates the column elements -into output array of shape :math:`(N, C, \text{output\_size}[0], \text{output\_size}[1], \dots)`. +into output array of shape :math:`(N, C, \text{output_size}[0], \text{output_size}[1], \dots)`. Only 1-D, 2-D and 3-D of spatial dimension is supported in this operator. )" ADD_FILELINE)