Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
57508672
提交
57508672
authored
11月 17, 2016
作者:
Vincent Dumoulin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add dilated convolution explanation to convolution arithmetic tutorial
上级
7fd891e9
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
62 行增加
和
1 行删除
+62
-1
conv_arithmetic.txt
doc/tutorial/conv_arithmetic.txt
+62
-1
dilation.gif
doc/tutorial/conv_arithmetic_figures/dilation.gif
+0
-0
没有找到文件。
doc/tutorial/conv_arithmetic.txt
浏览文件 @
57508672
...
...
@@ -878,8 +878,69 @@ Here is an example for :math:`i = 6`, :math:`k = 3`, :math:`s = 2` and :math:`p
.. figure:: conv_arithmetic_figures/padding_strides_odd_transposed.*
:figclass: align-center
Miscellaneous convolutions
==========================
Dilated convolutions
--------------------
Those familiar with the deep learning literature may have noticed the term
"dilated convolutions" (or *convolutions à trous*) appear in recent papers. Here
we attempt to provide an intuitive understanding of dilated convolutions. For a
more in-depth description and to understand in what contexts they are applied,
see `Chen et al. (2014) <https://arxiv.org/abs/1412.7062>`_ [#]_; `Yu and Koltun
(2015) <https://arxiv.org/abs/1511.07122>`_ [#]_.
Dilated convolutions "inflate" the kernel by inserting spaces between the kernel
elements. The dilation "rate" is controlled by an additional hyperparameter
:math:`d`. Implementations may vary, but there are usually :math:`d - 1` spaces
inserted between kernel elements such that :math:`d = 1` corresponds to a
regular convolution.
To understand the relationship tying the dilation rate :math:`d` and the output
size :math:`o`, it is useful to think of the impact of :math:`d` on the
*effective kernel size*. A kernel of size :math:`k` dilated by a factor
:math:`d` has an effective size
.. math::
\hat{k} = k + (k - 1)(d - 1).
This can be combined with Relationship 6 to form the following relationship for
dilated convolutions:
.. admonition:: Relationship 14
For any :math:`i`, :math:`k`, :math:`p` and :math:`s`, and for a dilation
rate :math:`d`,
.. math::
o = \left\lfloor \frac{i + 2p - k - (k - 1)(d - 1)}{s} \right\rfloor + 1.
This translates to the following Theano code:
.. code-block:: python
output = theano.tensor.nnet.conv2d(
input, filters, input_shape=(b, c2, i1, i2), filter_shape=(c1, c2, k1, k2),
border_mode=(p1, p2), subsample=(s1, s2), filter_dilation=(d1, d2))
# 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
Here is an example for :math:`i = 7`, :math:`k = 3`, :math:`d = 2`, :math:`s =
1` and :math:`p = 0`:
.. figure:: conv_arithmetic_figures/dilation.*
:figclass: align-center
.. [#] Dumoulin, Vincent, and Visin, Francesco. "A guide to convolution
arithmetic for deep learning." arXiv preprint arXiv:1603.07285 (2016)
arithmetic for deep learning". arXiv preprint arXiv:1603.07285 (2016)
.. [#] Chen, Liang-Chieh, Papandreou, George, Kokkinos, Iasonas, Murphy, Kevin
and Yuille, Alan L. "Semantic image segmentation with deep convolutional
nets and fully connected CRFs". arXiv preprint arXiv:1412.7062 (2014).
.. [#] Yu, Fisher and Koltun, Vladlen. "Multi-scale context aggregation by
dilated convolutions". arXiv preprint arXiv:1511.07122 (2015)
Quick reference
===============
...
...
doc/tutorial/conv_arithmetic_figures/dilation.gif
0 → 100644
浏览文件 @
57508672
122.0 KB
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论