Skip to content

Commit b6e67f6

Browse files
author
chengduo
authored
Merge pull request #6392 from chengduoZH/feature/fix_python_api_doc
Fix v2_API equation for img_pool and maxout format.
2 parents 00b64f6 + 3c84444 commit b6e67f6

File tree

1 file changed

+18
-16
lines changed
  • python/paddle/trainer_config_helpers

1 file changed

+18
-16
lines changed

python/paddle/trainer_config_helpers/layers.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2722,15 +2722,15 @@ def img_pool_layer(input,
27222722
27232723
.. math::
27242724
2725-
w = 1 + int(ceil(input\_width + 2 * padding - pool\_size) / float(stride))
2726-
h = 1 + int(ceil(input\_height + 2 * padding\_y - pool\_size\_y) / float(stride\_y))
2725+
w = 1 + \frac{ceil(input\_width + 2 * padding - pool\_size)}{stride} \\\\
2726+
h = 1 + \frac{ceil(input\_height + 2 * padding\_y - pool\_size\_y)}{stride\_y}
27272727
27282728
- ceil_mode=False:
27292729
27302730
.. math::
27312731
2732-
w = 1 + int(floor(input\_width + 2 * padding - pool\_size) / float(stride))
2733-
h = 1 + int(floor(input\_height + 2 * padding\_y - pool\_size\_y) / float(stride\_y))
2732+
w = 1 + \frac{floor(input\_width + 2 * padding - pool\_size)}{stride} \\\\
2733+
h = 1 + \frac{floor(input\_height + 2 * padding\_y - pool\_size\_y)}{stride\_y}
27342734
27352735
The example usage is:
27362736
@@ -2863,17 +2863,17 @@ def img_pool3d_layer(input,
28632863
28642864
.. math::
28652865
2866-
w = 1 + int(ceil(input\_width + 2 * padding - pool\_size) / float(stride))
2867-
h = 1 + int(ceil(input\_height + 2 * padding\_y - pool\_size\_y) / float(stride\_y))
2868-
d = 1 + int(ceil(input\_depth + 2 * padding\_z - pool\_size\_z) / float(stride\_z))
2866+
w = 1 + \frac{ceil(input\_width + 2 * padding - pool\_size)}{stride} \\\\
2867+
h = 1 + \frac{ceil(input\_height + 2 * padding\_y - pool\_size\_y)}{stride\_y} \\\\
2868+
d = 1 + \frac{ceil(input\_depth + 2 * padding\_z - pool\_size\_z)}{stride\_z}
28692869
28702870
- ceil_mode=False:
28712871
28722872
.. math::
28732873
2874-
w = 1 + int(floor(input\_width + 2 * padding - pool\_size) / float(stride))
2875-
h = 1 + int(floor(input\_height + 2 * padding\_y - pool\_size\_y) / float(stride\_y))
2876-
d = 1 + int(floor(input\_depth + 2 * padding\_z - pool\_size\_z) / float(stride\_z))
2874+
w = 1 + \frac{floor(input\_width + 2 * padding - pool\_size)}{stride} \\\\
2875+
h = 1 + \frac{floor(input\_height + 2 * padding\_y - pool\_size\_y)}{stride\_y} \\\\
2876+
d = 1 + \frac{floor(input\_depth + 2 * padding\_z - pool\_size\_z)}{stride\_z} \\\\
28772877
28782878
The example usage is:
28792879
@@ -5428,13 +5428,15 @@ def maxout_layer(input, groups, num_channels=None, name=None, layer_attr=None):
54285428
`Multi-digit Number Recognition from Street View Imagery using Deep Convolutional Neural Networks
54295429
https://arxiv.org/pdf/1312.6082v4.pdf`_
54305430
5431+
54315432
.. math::
5432-
y_{si+j} = \max_k x_{gsi + sk + j}
5433-
g = groups
5434-
s = input.size / num_channels
5435-
0 \le i < num_channels / groups
5436-
0 \le j < s
5437-
0 \le k < groups
5433+
out = \max_k (in[n, k, o_c , s]) \\\\
5434+
out_{i * s + j} = \max_k in_{ k * o_{c} * s + i * s + j} \\\\
5435+
s = \frac{input.size}{ num\_channels} \\\\
5436+
o_{c} =\frac{num\_channels}{groups} \\\\
5437+
0 \le i < o_{c} \\\\
5438+
0 \le j < s \\\\
5439+
0 \le k < groups \\\\
54385440
54395441
The simple usage is:
54405442

0 commit comments

Comments
 (0)