chainer.functions.average_pooling_2d¶
-
chainer.functions.
average_pooling_2d
(x, ksize, stride=None, pad=0)[source]¶ Spatial average pooling function.
This function acts similarly to
convolution_2d()
, but it computes the average of input spatial patch for each channel without any parameter instead of computing the inner products.- Parameters
x (Variable) – Input variable.
ksize (int or pair of ints) – Size of pooling window.
ksize=k
andksize=(k, k)
are equivalent.stride (int or pair of ints or None) – Stride of pooling applications.
stride=s
andstride=(s, s)
are equivalent. IfNone
is specified, then it uses same stride as the pooling window size.pad (int or pair of ints) – Spatial padding width for the input array.
pad=p
andpad=(p, p)
are equivalent.
- Returns
Output variable.
- Return type
Note
This function currently does not support
cover_all
mode asmax_pooling_2d()
. Average pooling runs in non-cover-all mode.Note
The values in the padded region is treated as 0, leading the averages biased towards zero. To obtain unbiased averages, use
average_pooling_nd()
withpad_value=None
.