MCPcopy
hub / github.com/tensorlayer/TensorLayer / MaxPool2d

Class MaxPool2d

tensorlayer/layers/pooling.py:269–341  ·  view source on GitHub ↗

Max pooling for 2D image. Parameters ----------- filter_size : tuple of int (height, width) for filter size. strides : tuple of int (height, width) for strides. padding : str The padding method: 'VALID' or 'SAME'. data_format : str One of chan

Source from the content-addressed store, hash-verified

267
268
269class MaxPool2d(Layer):
270 """Max pooling for 2D image.
271
272 Parameters
273 -----------
274 filter_size : tuple of int
275 (height, width) for filter size.
276 strides : tuple of int
277 (height, width) for strides.
278 padding : str
279 The padding method: 'VALID' or 'SAME'.
280 data_format : str
281 One of channels_last (default, [batch, height, width, channel]) or channels_first. The ordering of the dimensions in the inputs.
282 name : None or str
283 A unique layer name.
284
285 Examples
286 ---------
287 With TensorLayer
288
289 >>> net = tl.layers.Input([None, 50, 50, 32], name='input')
290 >>> net = tl.layers.MaxPool2d(filter_size=(3, 3), strides=(2, 2), padding='SAME')(net)
291 >>> output shape : [None, 25, 25, 32]
292
293 """
294
295 def __init__(
296 self,
297 filter_size=(3, 3),
298 strides=(2, 2),
299 padding='SAME',
300 data_format='channels_last',
301 name=None # 'maxpool2d'
302 ):
303 super().__init__(name)
304 self.filter_size = filter_size
305 if strides is None:
306 strides = filter_size
307 self.strides = self._strides = strides
308 self.padding = padding
309 self.data_format = data_format
310
311 self.build()
312 self._built = True
313
314 logging.info(
315 "MaxPool2d %s: filter_size: %s strides: %s padding: %s" %
316 (self.name, str(filter_size), str(strides), str(padding))
317 )
318
319 def __repr__(self):
320 s = ('{classname}(filter_size={filter_size}' ', strides={strides}, padding={padding}')
321 if self.name is not None:
322 s += ', name=\'{name}\''
323 s += ')'
324 return s.format(classname=self.__class__.__name__, **self.__dict__)
325
326 def build(self, inputs_shape=None):

Callers 15

make_layersFunction · 0.90
fire_blockFunction · 0.90
SqueezeNetV1Function · 0.90
ResNet50Function · 0.90
get_modelFunction · 0.90
get_model_batchnormFunction · 0.90
modelFunction · 0.90
modelFunction · 0.90
modelFunction · 0.90
modelFunction · 0.90
binary_modelFunction · 0.90
modelFunction · 0.90

Calls

no outgoing calls

Tested by 11

basic_static_modelFunction · 0.68
__init__Method · 0.68
get_modelMethod · 0.68
basic_static_modelFunction · 0.68
__init__Method · 0.68
basic_static_modelFunction · 0.68
__init__Method · 0.68
basic_static_modelFunction · 0.68
__init__Method · 0.68
basic_static_modelFunction · 0.68
__init__Method · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…