提交 99cb1b4e authored 作者: affanv14's avatar affanv14

add tutorial doc for grouped convolutions

上级 b998dc61
...@@ -944,6 +944,39 @@ Here is an example for :math:`i = 7`, :math:`k = 3`, :math:`d = 2`, :math:`s = ...@@ -944,6 +944,39 @@ Here is an example for :math:`i = 7`, :math:`k = 3`, :math:`d = 2`, :math:`s =
.. [#] Yu, Fisher and Koltun, Vladlen. "Multi-scale context aggregation by .. [#] Yu, Fisher and Koltun, Vladlen. "Multi-scale context aggregation by
dilated convolutions". arXiv preprint arXiv:1511.07122 (2015) dilated convolutions". arXiv preprint arXiv:1511.07122 (2015)
Grouped Convolutions
--------------------
In grouped convolutions with :math:`n` number of groups, the input and kernel
are split by their channels to form :math:`n` distinct groups. Each group
performs convolutions independent of the other groups to give :math:`n`
different outputs. These individual outputs are then concatenated together to give
the final output. A few examples of works using grouped convolutions are `Krizhevsky et al (2012)
<https://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks>`_ [#]_;
`Xie et at (2016) <https://arxiv.org/abs/1611.05431>`_ [#]_.
A special case of grouped convolutions is when :math:`n` equals the number of input
channels. This is called depth-wise convolutions or channel-wise convolutions.
An example to use Grouped convolutions would be:
.. code-block:: python
output = theano.tensor.nnet.conv2d(
input, filters, input_shape=(b, c2, i1, i2), filter_shape=(c1, c2 / n, k1, k2),
border_mode=(p1, p2), subsample=(s1, s2), filter_dilation=(d1, d2), num_groups=n)
# output.shape[0] == b
# output.shape[1] == c1
# output.shape[2] == (i1 + 2 * p1 - k1 - (k1 - 1) * (d1 - 1)) // s1 + 1
# output.shape[3] == (i2 + 2 * p2 - k2 - (k2 - 1) * (d2 - 1)) // s2 + 1
.. [#] Alex Krizhevsky, Ilya Sutskever, Geoffrey E. Hinton. "ImageNet
Classification with Deep Convolutional Neural Networks".
Advances in Neural Information Processing Systems 25 (NIPS 2012)
.. [#] Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, Kaiming He.
"Aggregated Residual Transformations for Deep Neural Networks".
arxiv preprint arXiv:1611.05431 (2016).
Quick reference Quick reference
=============== ===============
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论