chainerx.average_pool¶
-
chainerx.average_pool(x, ksize, stride=None, pad=0, pad_mode='ignore')¶ Spatial average pooling function.
This acts similarly to
conv(), but it computes the average of input spatial patch for each channel without any parameter instead of computing the inner products.- Parameters
x (ndarray) – Input array.
ksize (int or tuple of ints) – Size of pooling window.
ksize=kandksize=(k, k, ..., k)are equivalent.stride (int or tuple of ints or None) – Stride of pooling applications.
stride=sandstride=(s, s, ..., s)are equivalent. IfNoneis specified, then it uses same stride as the pooling window size.pad (int or tuple of ints) – Spatial padding width for the input array.
pad=pandpad=(p, p, ..., p)are equivalent.pad_mode ({'zero', 'ignore'}) –
Specifies how padded region is treated.
’zero’ – the values in the padded region are treated as 0
’ignore’ – padded region is ignored (default)
- Returns
Output array.
- Return type
Note
During backpropagation, this function propagates the gradient of the output array to the input array
x.Note
In
cudabackend, only 2 and 3 dim arrays are supported asxbecause cuDNN pooling supports 2 and 3 spatial dimensions.