chainer.functions.unpooling_2d

chainer.functions.unpooling_2d(x, ksize, stride=None, pad=0, outsize=None, cover_all=True)[source]

Inverse operation of pooling for 2d array.

This function acts similarly to Deconvolution2D, but it spreads input 2d array’s value 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 and ksize=(k, k) are equivalent.
  • stride (int, pair of ints or None) – Stride of pooling applications. stride=s and stride=(s, s) are equivalent. If None 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 and pad=(p, p) are equivalent.
  • outsize (None or pair of ints) – Expected output size (height, width) of array after the operation. If None, the size (height or width) is estimated from the size of input array in first batch with get_deconv_outsize(). If outsize is not None, the result of outsize applied to get_conv_outsize() must be equal to the shape of the 2d array in the input batch x.
  • cover_all (bool) – If True, the output size may be smaller than the size if cover_all is False. This flag serves to align behavior to the pooling functions which can cover all input locations, see max_pooling_2d() and convolution_2d().
Returns:

Output variable.

Return type:

Variable