Skip to main content

Add Global Pooling Layer

Synopsis

Adds a global pooling layer to your neural net structure. Global pooling can be used for networks containing convolutional layers or recurrent layers like the LSTM layer.

Description

This operator has to be placed into the subprocess of the Deep Learning operator. It adds a global pooling layer to the neural net structure.

Pooling is a technique used to aggregate values from activation maps created by convolutional layers or for aggregating values over time when using recurrent layers. Add this operator for example after an "Add Convolutional Layer" operator to reduce the number of parameters to tune. The aggregation can be done by using different methods. Set a method using the pooling method parameter.

The range of data that should be used for one aggregation step can be set with the kernel size parameter and the step size used for moving this range across the input data is set using the stride size parameter.

Input

layerArchitecture

A network configuration setup with previous operators. Connect this port to the layerArchitecture output port of another add layer operator or to the layer port of the "Deep Learning" operator if this layer is the first one.

Output

layerArchitecture

The network with the configuration for this pooling layer added. Connect this port to the next input port of another layer or the layer port on the right side of the "Deep Learning" operator.

Parameters

Pooling method

Select a method that is used for aggregating values present in a given range of data defined by the kernel size.

Kernel size

Provide two values to set the kernel height and width. A kernel is randomly initiated and used to define the area that is used for aggregation. It is moving over the input data using a step size set by the stride size parameter.

When performing pooling on text data, the second kernel size value should be equal to the number of dimensions that the used Word2Vec model has. E.g. the standard Google News Word2Vec model uses 300 dimensions to describe one word, hence a common setting for the kernel size would be 3 and 300 here, where the first value is one to choose.

Stride size

Provide two values for the steps to done both in the height and width dimension. The stride value is used to move the kernel a given number of inputs.

The values chosen for stride influence the shape of this layers output data. Using a stride of 2 for example, would result in a down sampling.

When performing pooling on text data, the second stride size value should be equal to the number of dimensions that the used Word2Vec model has. E.g. the standard Google News Word2Vec model uses 300 dimensions to describe one word, hence a common setting for the kernel size would be 1 and 300 here, where the first value is one to choose.

Collapse dimensions

Choose if dimensions should be reduced during pooling or not. Find the typical reduction behaviour below: True selected: 3d (time series) input with shape [miniBatchSize, vectorSize, timeSeriesLength] -> 2d output [miniBatchSize, vectorSize] 4d (CNN) input with shape [miniBatchSize, channels, height, width] -> 2d output [miniBatchSize, channels] False selected: 3d (time series) input with shape [miniBatchSize, vectorSize, timeSeriesLength] -> 3d output [miniBatchSize, vectorSize, 1] 4d (CNN) input with shape [miniBatchSize, channels, height, width] -> 2d output [miniBatchSize, channels, 1, 1] (Definitions taken from the DL4J docu.)

Layer name

Provide a name for the layer for ease of identification, when inspecting the model or re-using it.