Skip to content


2D max pooling.

This layer applies 2D max pooling for spatial data to an input.


  • pool_size : Integer(s), factors by which to downscale (vertical, horizontal).
    Two integers mean [pool_h, pool_w].
    One integer means that pool_h and pool_w have the same value.
    Default is [2, 2].
  • strides : Integer(s), stride values.
    Two integers mean [stride_y, stride_x].
    One integer means that stride_y and stride_x have the same value.
    Default is [2, 2].
  • padding : String, padding mode.
    'same_upper' and 'valid' is compatible with 'same' and 'valid' on Keras (TensorFlow) respectively.
    'general' is arbitrary padding.
    'caffe' is compatible with Caffe.
    Default is 'valid'.
  • pads : Integer(s), pad value(s). Valid when padding is 'general'.
    Four integers mean [pad_top, pad_left, pad_bottom, pad_right].
    Two integers mean [pad_top, pad_left] where pad_bottom and pad_right are same as pad_top and pad_left respectively.
    One integer means that pad_top, pad_left, pad_bottom and pad_right have the same value.
    Default is [0, 0, 0, 0].