Skip to content

Commit e231f5e

Browse files
authored
update docs depthwise example (#441)
1 parent dc6fb7e commit e231f5e

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ as well as engineers from Google, Microsoft, Alibaba, Tencent, Penguins Innovate
273273
If you find this project useful, we would be grateful if you cite the TensorLayer paper:
274274

275275
```
276-
@article{haoTL2017,
276+
@article{tensorlayer2017,
277277
author = {Dong, Hao and Supratak, Akara and Mai, Luo and Liu, Fangde and Oehmichen, Axel and Yu, Simiao and Guo, Yike},
278278
journal = {ACM Multimedia},
279279
title = {{TensorLayer: A Versatile Library for Efficient Deep Learning Development}},

tensorlayer/layers/convolution.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,12 +1615,19 @@ class DepthwiseConv2d(Layer):
16151615
16161616
Examples
16171617
---------
1618-
>>> x = tf.placeholder(tf.float32, shape=[None, 28, 28, 1], name='x')
1619-
>>> net = InputLayer(x, name='in')
1620-
>>> net = Conv2d(net, 32, (3, 3), (1, 1), name='conv1')
1621-
>>> net = MaxPool2d(net, (2, 2), name='pool1')
1622-
>>> net = DepthwiseConv2d(net, (3, 3), (1, 1), act=tf.nn.relu, name='dethwise1')
1623-
>>> net = Conv2d(net, 64, (1, 1), (1, 1), act=tf.nn.relu, name='conv2')
1618+
>>> net = InputLayer(x, name='input')
1619+
>>> net = Conv2d(net, 32, (3, 3), (2, 2), b_init=None, name='cin')
1620+
>>> net = BatchNormLayer(net, act=tf.nn.relu, is_train=is_train, name='bnin')
1621+
...
1622+
>>> net = DepthwiseConv2d(net, (3, 3), (1, 1), b_init=None, name='cdw1')
1623+
>>> net = BatchNormLayer(net, act=tf.nn.relu, is_train=is_train, name='bn11')
1624+
>>> net = Conv2d(net, 64, (1, 1), (1, 1), b_init=None, name='c1')
1625+
>>> net = BatchNormLayer(net, act=tf.nn.relu, is_train=is_train, name='bn12')
1626+
...
1627+
>>> net = DepthwiseConv2d(net, (3, 3), (2, 2), b_init=None, name='cdw2')
1628+
>>> net = BatchNormLayer(net, act=tf.nn.relu, is_train=is_train, name='bn21')
1629+
>>> net = Conv2d(net, 128, (1, 1), (1, 1), b_init=None, name='c2')
1630+
>>> net = BatchNormLayer(net, act=tf.nn.relu, is_train=is_train, name='bn22')
16241631
16251632
References
16261633
-----------

0 commit comments

Comments
 (0)