GlobalMaxPooling3DLayer - 3-D global max pooling layer - MATLAB (original) (raw)

3-D global max pooling layer

Description

A 3-D global max pooling layer performs downsampling by computing the maximum of the height, width, and depth dimensions of the input.

Creation

Syntax

Description

`layer` = globalMaxPooling3dLayer creates a 3-D global max pooling layer.

`layer` = globalMaxPooling3dLayer('Name',name) sets the optional Name property.

example

Properties

expand all

Data Types: char | string

This property is read-only.

Number of inputs to the layer, stored as 1. This layer accepts a single input only.

Data Types: double

This property is read-only.

Input names, stored as {'in'}. This layer accepts a single input only.

Data Types: cell

This property is read-only.

Number of outputs from the layer, stored as 1. This layer has a single output only.

Data Types: double

This property is read-only.

Output names, stored as {'out'}. This layer has a single output only.

Data Types: cell

Object Functions

Examples

collapse all

Create a 3-D global max pooling layer with name 'gmp1'.

layer = globalMaxPooling3dLayer('Name','gmp1')

layer = GlobalMaxPooling3DLayer with properties:

Name: 'gmp1'

Include a 3-D max pooling layer in a Layer array.

layers = [ ... image3dInputLayer([28 28 28 3]) convolution3dLayer(5,20) reluLayer globalMaxPooling3dLayer fullyConnectedLayer(10) softmaxLayer]

layers = 6×1 Layer array with layers:

 1   ''   3-D Image Input          28×28×28×3 images with 'zerocenter' normalization
 2   ''   3-D Convolution          20 5×5×5 convolutions with stride [1  1  1] and padding [0  0  0; 0  0  0]
 3   ''   ReLU                     ReLU
 4   ''   3-D Global Max Pooling   3-D global max pooling
 5   ''   Fully Connected          10 fully connected layer
 6   ''   Softmax                  softmax

Tips

Algorithms

expand all

A 3-D global max pooling layer performs downsampling by computing the maximum of the height, width, and depth dimensions of the input.

The dimensions that the layer pools over depends on the layer input:

Layers in a layer array or layer graph pass data to subsequent layers as formatted dlarray objects. The format of a dlarray object is a string of characters in which each character describes the corresponding dimension of the data. The format consists of one or more of these characters:

For example, you can describe 2-D image data that is represented as a 4-D array, where the first two dimensions correspond to the spatial dimensions of the images, the third dimension corresponds to the channels of the images, and the fourth dimension corresponds to the batch dimension, as having the format "SSCB" (spatial, spatial, channel, batch).

You can interact with these dlarray objects in automatic differentiation workflows, such as those for developing a custom layer, using a functionLayer object, or using the forward and predict functions withdlnetwork objects.

This table shows the supported input formats of GlobalMaxPooling3DLayer objects and the corresponding output format. If the software passes the output of the layer to a custom layer that does not inherit from the nnet.layer.Formattable class, or aFunctionLayer object with the Formattable property set to 0 (false), then the layer receives an unformatted dlarray object with dimensions ordered according to the formats in this table. The formats listed here are only a subset. The layer may support additional formats such as formats with additional "S" (spatial) or"U" (unspecified) dimensions.

Input Format Output Format
"SSSCB" (spatial, spatial, spatial, channel, batch) "SSSCB" (spatial, spatial, spatial, channel, batch)
"SSSC" (spatial, spatial, spatial, channel) "SSSC" (spatial, spatial, spatial, channel)

In dlnetwork objects, GlobalMaxPooling3DLayer objects also support these input and output format combinations.

Input Format Output Format
"SSSCBT" (spatial, spatial, spatial, channel, batch, time) "SSSCBT" (spatial, spatial, spatial, channel, batch, time)
"SSSCT" (spatial, spatial, spatial, channel, time) "SSSCT" (spatial, spatial, spatial, channel, time)

Version History

Introduced in R2020a