%% Create Average Pooling Layer
% Create an average pooling layer with the name 'avg1'.

layer = averagePooling2dLayer(2,'Name','avg1')

% Include an average pooling layer in a Layer array.

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

% Copyright 2019 The MathWorks, Inc.