%% Create Max Pooling Layer with Overlapping Pooling Regions
% Create a max pooling layer with overlapping pooling regions.

layer = maxPooling2dLayer([3 2],'Stride',2)

% This layer creates pooling regions of size [3 2] and takes the maximum of the six elements in each region. The pooling regions overlap because there are stride dimensions Stride that are less than the respective pooling dimensions PoolSize.
% Include a max pooling layer with overlapping pooling regions in a Layer array.

layers = [ ...
    imageInputLayer([28 28 1])
    convolution2dLayer(5,20)
    reluLayer
    maxPooling2dLayer([3 2],'Stride',2)
    fullyConnectedLayer(10)
    softmaxLayer
    classificationLayer]

% Copyright 2012 The MathWorks, Inc.