create_dl_layer_poolingT_create_dl_layer_poolingCreateDlLayerPoolingCreateDlLayerPoolingcreate_dl_layer_pooling (Operator)

Name

create_dl_layer_poolingT_create_dl_layer_poolingCreateDlLayerPoolingCreateDlLayerPoolingcreate_dl_layer_pooling — Create a pooling layer.

Signature

create_dl_layer_pooling( : : DLLayerInput, LayerName, KernelSize, Stride, Padding, Mode, GenParamName, GenParamValue : DLLayerPooling)

Herror T_create_dl_layer_pooling(const Htuple DLLayerInput, const Htuple LayerName, const Htuple KernelSize, const Htuple Stride, const Htuple Padding, const Htuple Mode, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DLLayerPooling)

void CreateDlLayerPooling(const HTuple& DLLayerInput, const HTuple& LayerName, const HTuple& KernelSize, const HTuple& Stride, const HTuple& Padding, const HTuple& Mode, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerPooling)

HDlLayer HDlLayer::CreateDlLayerPooling(const HString& LayerName, const HTuple& KernelSize, const HTuple& Stride, const HTuple& Padding, const HString& Mode, const HTuple& GenParamName, const HTuple& GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerPooling(const HString& LayerName, const HTuple& KernelSize, const HTuple& Stride, const HString& Padding, const HString& Mode, const HString& GenParamName, const HString& GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerPooling(const char* LayerName, const HTuple& KernelSize, const HTuple& Stride, const char* Padding, const char* Mode, const char* GenParamName, const char* GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerPooling(const wchar_t* LayerName, const HTuple& KernelSize, const HTuple& Stride, const wchar_t* Padding, const wchar_t* Mode, const wchar_t* GenParamName, const wchar_t* GenParamValue) const   (Windows only)

static void HOperatorSet.CreateDlLayerPooling(HTuple DLLayerInput, HTuple layerName, HTuple kernelSize, HTuple stride, HTuple padding, HTuple mode, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerPooling)

HDlLayer HDlLayer.CreateDlLayerPooling(string layerName, HTuple kernelSize, HTuple stride, HTuple padding, string mode, HTuple genParamName, HTuple genParamValue)

HDlLayer HDlLayer.CreateDlLayerPooling(string layerName, HTuple kernelSize, HTuple stride, string padding, string mode, string genParamName, string genParamValue)

def create_dl_layer_pooling(dllayer_input: HHandle, layer_name: str, kernel_size: Sequence[int], stride: Sequence[int], padding: MaybeSequence[Union[str, int]], mode: str, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]]) -> HHandle

Description

The operator create_dl_layer_poolingcreate_dl_layer_poolingCreateDlLayerPoolingCreateDlLayerPoolingCreateDlLayerPoolingcreate_dl_layer_pooling creates a pooling layer whose handle is returned in DLLayerPoolingDLLayerPoolingDLLayerPoolingDLLayerPoolingDLLayerPoolingdllayer_pooling.

The parameter DLLayerInputDLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input determines the feeding input layer and expects the layer handle as value.

The parameter LayerNameLayerNameLayerNameLayerNamelayerNamelayer_name sets an individual layer name. Note that if creating a model using create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelCreateDlModelcreate_dl_model each layer of the created network must have an unique name.

The parameter KernelSizeKernelSizeKernelSizeKernelSizekernelSizekernel_size specifies the filter kernel in the dimensions width and height.

The parameter StrideStrideStrideStridestridestride specifies how the filter is shifted.

The values for KernelSizeKernelSizeKernelSizeKernelSizekernelSizekernel_size and StrideStrideStrideStridestridestride can be set as

The parameter PaddingPaddingPaddingPaddingpaddingpadding determines the padding, thus how many pixels with value 0 are appended on the boarder of the processed input image. Supported values are:

The output dimensions of the pooling layer are given by Thereby we use the following values: : output width, : input width, : corresponding entry in KernelSizeKernelSizeKernelSizeKernelSizekernelSizekernel_size, : corresponding entry in StrideStrideStrideStridestridestride, : number of pixels added to the left/top of the input image, and : number of pixels added to the right/bottom of the input image.

The parameter ModeModeModeModemodemode specifies the mode of the pooling operation. Supported modes are:

'average'"average""average""average""average""average":

The resulting pixel value is the average of all pixel values in the filter.

'maximum'"maximum""maximum""maximum""maximum""maximum":

The resulting pixel value is the maximum of all pixel values in the filter.

'global_average'"global_average""global_average""global_average""global_average""global_average":

Same as mode 'average'"average""average""average""average""average", but the internally used kernel size is changed to and the internally used stride is set to the new kernel size. Following the above formula, this can be used to control the desired output dimensions without the knowledge of the dimensions of the input dimensions. E.g., if the average over all pixel values of the input shall be returned, set the kernel_size to 1 and the output width and height is equal to 1. As a consequence, the output dimension equals the kernel size if the kernel size is a divisor of the input dimension.

'global_maximum'"global_maximum""global_maximum""global_maximum""global_maximum""global_maximum":

Same as mode 'global_average'"global_average""global_average""global_average""global_average""global_average", but the maximum is calculated instead of the average.

For more information about the pooling layer see the “Solution Guide on Classification”.

The following generic parameters GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and the corresponding values GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value are supported:

'is_inference_output'"is_inference_output""is_inference_output""is_inference_output""is_inference_output""is_inference_output":

Determines whether apply_dl_modelapply_dl_modelApplyDlModelApplyDlModelApplyDlModelapply_dl_model will include the output of this layer in the dictionary DLResultBatchDLResultBatchDLResultBatchDLResultBatchDLResultBatchdlresult_batch even without specifying this layer in OutputsOutputsOutputsOutputsoutputsoutputs ('true'"true""true""true""true""true") or not ('false'"false""false""false""false""false").

Default: 'false'"false""false""false""false""false"

'num_trainable_params'"num_trainable_params""num_trainable_params""num_trainable_params""num_trainable_params""num_trainable_params":

Number of trainable parameters (weights and biases) of the layer.

Certain parameters of layers created using this operator create_dl_layer_poolingcreate_dl_layer_poolingCreateDlLayerPoolingCreateDlLayerPoolingCreateDlLayerPoolingcreate_dl_layer_pooling can be set and retrieved using further operators. The following tables give an overview, which parameters can be set using set_dl_model_layer_paramset_dl_model_layer_paramSetDlModelLayerParamSetDlModelLayerParamSetDlModelLayerParamset_dl_model_layer_param and which ones can be retrieved using get_dl_model_layer_paramget_dl_model_layer_paramGetDlModelLayerParamGetDlModelLayerParamGetDlModelLayerParamget_dl_model_layer_param or get_dl_layer_paramget_dl_layer_paramGetDlLayerParamGetDlLayerParamGetDlLayerParamget_dl_layer_param. Note, the operators set_dl_model_layer_paramset_dl_model_layer_paramSetDlModelLayerParamSetDlModelLayerParamSetDlModelLayerParamset_dl_model_layer_param and get_dl_model_layer_paramget_dl_model_layer_paramGetDlModelLayerParamGetDlModelLayerParamGetDlModelLayerParamget_dl_model_layer_param require a model created by create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelCreateDlModelcreate_dl_model.

Layer Parameters set get
'global'"global""global""global""global""global"
'input_layer'"input_layer""input_layer""input_layer""input_layer""input_layer" (DLLayerInputDLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input)
'kernel_size'"kernel_size""kernel_size""kernel_size""kernel_size""kernel_size" (KernelSizeKernelSizeKernelSizeKernelSizekernelSizekernel_size)
'name'"name""name""name""name""name" (LayerNameLayerNameLayerNameLayerNamelayerNamelayer_name)
'output_layer'"output_layer""output_layer""output_layer""output_layer""output_layer" (DLLayerPoolingDLLayerPoolingDLLayerPoolingDLLayerPoolingDLLayerPoolingdllayer_pooling)
'padding'"padding""padding""padding""padding""padding" (PaddingPaddingPaddingPaddingpaddingpadding)
'padding_type'"padding_type""padding_type""padding_type""padding_type""padding_type" (PaddingPaddingPaddingPaddingpaddingpadding)
'pooling_mode'"pooling_mode""pooling_mode""pooling_mode""pooling_mode""pooling_mode" (ModeModeModeModemodemode)
'shape'"shape""shape""shape""shape""shape"
'stride'"stride""stride""stride""stride""stride" (StrideStrideStrideStridestridestride)
'type'"type""type""type""type""type"
Generic Layer Parameters set get
'is_inference_output'"is_inference_output""is_inference_output""is_inference_output""is_inference_output""is_inference_output"
'num_trainable_params'"num_trainable_params""num_trainable_params""num_trainable_params""num_trainable_params""num_trainable_params"

Execution Information

Parameters

DLLayerInputDLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input (input_control)  dl_layer HDlLayer, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Feeding layer.

LayerNameLayerNameLayerNameLayerNamelayerNamelayer_name (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Name of the layer.

KernelSizeKernelSizeKernelSizeKernelSizekernelSizekernel_size (input_control)  number-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Width and height of the filter kernels.

Default value: [2,2]

StrideStrideStrideStridestridestride (input_control)  number-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Bi-dimensional amount of filter shift.

Default value: [2,2]

PaddingPaddingPaddingPaddingpaddingpadding (input_control)  number(-array) HTupleMaybeSequence[Union[str, int]]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

Type of padding.

Default value: 'none' "none" "none" "none" "none" "none"

Suggested values: 'none'"none""none""none""none""none", 'half_kernel_size'"half_kernel_size""half_kernel_size""half_kernel_size""half_kernel_size""half_kernel_size", 'implicit'"implicit""implicit""implicit""implicit""implicit"

ModeModeModeModemodemode (input_control)  number HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Mode of pooling operation.

Default value: 'maximum' "maximum" "maximum" "maximum" "maximum" "maximum"

List of values: 'average'"average""average""average""average""average", 'global_average'"global_average""global_average""global_average""global_average""global_average", 'global_maximum'"global_maximum""global_maximum""global_maximum""global_maximum""global_maximum", 'maximum'"maximum""maximum""maximum""maximum""maximum"

GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control)  attribute.name(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Generic input parameter names.

Default value: []

List of values: 'is_inference_output'"is_inference_output""is_inference_output""is_inference_output""is_inference_output""is_inference_output"

GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (input_control)  attribute.value(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Generic input parameter values.

Default value: []

Suggested values: 'true'"true""true""true""true""true", 'false'"false""false""false""false""false", 1.0, 0.9, 0.0

DLLayerPoolingDLLayerPoolingDLLayerPoolingDLLayerPoolingDLLayerPoolingdllayer_pooling (output_control)  dl_layer HDlLayer, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Pooling layer.

Module

Deep Learning Training