%% Create Average Pooling Layer with Overlapping Pooling Regions
% Create an average pooling layer with overlapping pooling regions.

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

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

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

% Copyright 2012 The MathWorks, Inc.