def __init__(self, incoming, pool_size, stride=None, pad=(0, 0),
ignore_border=True, centered=True, **kwargs):
"""A padded pooling layer
Parameters
----------
incoming : lasagne.layers.Layer
The input layer
pool_size : int
The size of the pooling
stride : int or iterable of int
The stride or subsampling of the convolution
pad : int, iterable of int, ``full``, ``same`` or ``valid``
**Ignored!** Kept for compatibility with the
:class:``lasagne.layers.Pool2DLayer``
ignore_border : bool
See :class:``lasagne.layers.Pool2DLayer``
centered : bool
If True, the padding will be added on both sides. If False
the zero padding will be applied on the upper left side.
**kwargs
Any additional keyword arguments are passed to the Layer
superclass
"""
self.centered = centered
if pad not in [0, (0, 0), [0, 0]]:
warnings.warn('The specified padding will be ignored',
RuntimeWarning)
super(PaddedPool2DLayer, self).__init__(incoming,
pool_size,
stride,
pad,
ignore_border,
**kwargs)
if self.input_shape[2:] != (None, None):
warnings.warn('This Layer should only be used when the size of '
'the image is not known', RuntimeWarning)
评论列表
文章目录