create_dl_layer_convolutionT_create_dl_layer_convolutionCreateDlLayerConvolutionCreateDlLayerConvolutioncreate_dl_layer_convolution (Operator)

Name

create_dl_layer_convolutionT_create_dl_layer_convolutionCreateDlLayerConvolutionCreateDlLayerConvolutioncreate_dl_layer_convolution — Create a convolutional layer.

Signature

create_dl_layer_convolution( : : DLLayerInput, LayerName, KernelSize, Dilation, Stride, NumKernel, Groups, Padding, Activation, GenParamName, GenParamValue : DLLayerConvolution)

Herror T_create_dl_layer_convolution(const Htuple DLLayerInput, const Htuple LayerName, const Htuple KernelSize, const Htuple Dilation, const Htuple Stride, const Htuple NumKernel, const Htuple Groups, const Htuple Padding, const Htuple Activation, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DLLayerConvolution)

void CreateDlLayerConvolution(const HTuple& DLLayerInput, const HTuple& LayerName, const HTuple& KernelSize, const HTuple& Dilation, const HTuple& Stride, const HTuple& NumKernel, const HTuple& Groups, const HTuple& Padding, const HTuple& Activation, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerConvolution)

HDlLayer HDlLayer::CreateDlLayerConvolution(const HString& LayerName, const HTuple& KernelSize, const HTuple& Dilation, const HTuple& Stride, Hlong NumKernel, Hlong Groups, const HTuple& Padding, const HString& Activation, const HTuple& GenParamName, const HTuple& GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerConvolution(const HString& LayerName, Hlong KernelSize, Hlong Dilation, Hlong Stride, Hlong NumKernel, Hlong Groups, const HString& Padding, const HString& Activation, const HString& GenParamName, const HString& GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerConvolution(const char* LayerName, Hlong KernelSize, Hlong Dilation, Hlong Stride, Hlong NumKernel, Hlong Groups, const char* Padding, const char* Activation, const char* GenParamName, const char* GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerConvolution(const wchar_t* LayerName, Hlong KernelSize, Hlong Dilation, Hlong Stride, Hlong NumKernel, Hlong Groups, const wchar_t* Padding, const wchar_t* Activation, const wchar_t* GenParamName, const wchar_t* GenParamValue) const   (Windows only)

static void HOperatorSet.CreateDlLayerConvolution(HTuple DLLayerInput, HTuple layerName, HTuple kernelSize, HTuple dilation, HTuple stride, HTuple numKernel, HTuple groups, HTuple padding, HTuple activation, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerConvolution)

HDlLayer HDlLayer.CreateDlLayerConvolution(string layerName, HTuple kernelSize, HTuple dilation, HTuple stride, int numKernel, int groups, HTuple padding, string activation, HTuple genParamName, HTuple genParamValue)

HDlLayer HDlLayer.CreateDlLayerConvolution(string layerName, int kernelSize, int dilation, int stride, int numKernel, int groups, string padding, string activation, string genParamName, string genParamValue)

def create_dl_layer_convolution(dllayer_input: HHandle, layer_name: str, kernel_size: MaybeSequence[int], dilation: MaybeSequence[int], stride: MaybeSequence[int], num_kernel: int, groups: int, padding: MaybeSequence[Union[str, int]], activation: str, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]]) -> HHandle

Description

The operator create_dl_layer_convolutioncreate_dl_layer_convolutionCreateDlLayerConvolutionCreateDlLayerConvolutionCreateDlLayerConvolutioncreate_dl_layer_convolution creates a convolutional layer with NumKernelNumKernelNumKernelNumKernelnumKernelnum_kernel kernels in GroupsGroupsGroupsGroupsgroupsgroups filter groups whose handle is returned in DLLayerConvolutionDLLayerConvolutionDLLayerConvolutionDLLayerConvolutionDLLayerConvolutiondllayer_convolution.

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 a unique name.

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

The parameter DilationDilationDilationDilationdilationdilation specifies the factor of filter dilation in the dimensions width and height.

The parameter StrideStrideStrideStridestridestride specifies how the filter is shifted.

The values for KernelSizeKernelSizeKernelSizeKernelSizekernelSizekernel_size, DilationDilationDilationDilationdilationdilation, and StrideStrideStrideStridestridestride can be set as

The parameter GroupsGroupsGroupsGroupsgroupsgroups specifies the number of filter groups.

The parameter NumKernelNumKernelNumKernelNumKernelnumKernelnum_kernel specifies the number of filter kernels. NumKernelNumKernelNumKernelNumKernelnumKernelnum_kernel must be a multiple of GroupsGroupsGroupsGroupsgroupsgroups.

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

The output dimensions of the convolution layer are given by Thereby we use the following values: : output width/height, : input width/height, : 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 ActivationActivationActivationActivationactivationactivation determines whether an activation is performed after the convolution in order to optimize the runtime performance. The following values are supported:

We refer to the “Solution Guide on Classification” for more general information about the convolution layer and the reference given below for more detailed information about the arithmetic of the layer.

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

'bias_filler'"bias_filler""bias_filler""bias_filler""bias_filler""bias_filler":

See 'weight_filler'"weight_filler""weight_filler""weight_filler""weight_filler""weight_filler" for an explanation of the values.

List of values: 'xavier'"xavier""xavier""xavier""xavier""xavier", 'msra'"msra""msra""msra""msra""msra", 'const'"const""const""const""const""const".

Default: 'const'"const""const""const""const""const"

'bias_filler_variance_norm'"bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm":

See 'weight_filler_variance_norm'"weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm" for an explanation of the values.

List of values: 'norm_in'"norm_in""norm_in""norm_in""norm_in""norm_in", 'norm_out'"norm_out""norm_out""norm_out""norm_out""norm_out", 'norm_average'"norm_average""norm_average""norm_average""norm_average""norm_average".

Default: 'norm_out'"norm_out""norm_out""norm_out""norm_out""norm_out"

'bias_filler_const_val'"bias_filler_const_val""bias_filler_const_val""bias_filler_const_val""bias_filler_const_val""bias_filler_const_val":

Specifies the constant bias term initialization value if 'bias_filler'"bias_filler""bias_filler""bias_filler""bias_filler""bias_filler" has been set to 'const'"const""const""const""const""const".

Restriction: Ignored for other values of 'bias_filler'"bias_filler""bias_filler""bias_filler""bias_filler""bias_filler".

Default: 0

'bias_term'"bias_term""bias_term""bias_term""bias_term""bias_term":

Determines whether the created convolutional layer has a bias term ('true'"true""true""true""true""true") or not ('false'"false""false""false""false""false").

Default: 'true'"true""true""true""true""true"

'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"

'learning_rate_multiplier'"learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier":

Multiplier for the learning rate for this layer that is used during training. If 'learning_rate_multiplier'"learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier" is set to 0.0, the layer is skipped during training.

Default: 1.0

'learning_rate_multiplier_bias'"learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias":

Multiplier for the learning rate of the bias term. The total bias learning rate is the product of 'learning_rate_multiplier_bias'"learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias" and 'learning_rate_multiplier'"learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier".

Default: 1.0

'upper_bound'"upper_bound""upper_bound""upper_bound""upper_bound""upper_bound":

Float value, which defines the upper bound for ReLU. To unset the upper bound, set 'upper_bound'"upper_bound""upper_bound""upper_bound""upper_bound""upper_bound" to an empty tuple.

Default: []

'weight_filler'"weight_filler""weight_filler""weight_filler""weight_filler""weight_filler":

This parameter defines the mode how the weights are initialized. The following values are supported:

Default: 'xavier'"xavier""xavier""xavier""xavier""xavier"

'weight_filler_const_val'"weight_filler_const_val""weight_filler_const_val""weight_filler_const_val""weight_filler_const_val""weight_filler_const_val":

Specifies the constant weight initialization value.

Restriction: Only applied if 'weight_filler'"weight_filler""weight_filler""weight_filler""weight_filler""weight_filler" = 'const'"const""const""const""const""const".

Default: 0.5

'weight_filler_variance_norm'"weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm":

This parameter determines the value range for 'weight_filler'"weight_filler""weight_filler""weight_filler""weight_filler""weight_filler". The following values are supported:

Default: 'norm_in'"norm_in""norm_in""norm_in""norm_in""norm_in"

Certain parameters of layers created using create_dl_layer_convolutioncreate_dl_layer_convolutionCreateDlLayerConvolutionCreateDlLayerConvolutionCreateDlLayerConvolutioncreate_dl_layer_convolution 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
'activation_mode'"activation_mode""activation_mode""activation_mode""activation_mode""activation_mode" (ActivationActivationActivationActivationactivationactivation)
'dilation'"dilation""dilation""dilation""dilation""dilation" (DilationDilationDilationDilationdilationdilation)
'groups'"groups""groups""groups""groups""groups" (GroupsGroupsGroupsGroupsgroupsgroups)
'input_depth'"input_depth""input_depth""input_depth""input_depth""input_depth"
'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)
'num_kernels'"num_kernels""num_kernels""num_kernels""num_kernels""num_kernels" (NumKernelNumKernelNumKernelNumKernelnumKernelnum_kernel)
'output_layer'"output_layer""output_layer""output_layer""output_layer""output_layer" (DLLayerConvolutionDLLayerConvolutionDLLayerConvolutionDLLayerConvolutionDLLayerConvolutiondllayer_convolution)
'padding'"padding""padding""padding""padding""padding" (PaddingPaddingPaddingPaddingpaddingpadding)
'padding_type'"padding_type""padding_type""padding_type""padding_type""padding_type" (PaddingPaddingPaddingPaddingpaddingpadding)
'shape'"shape""shape""shape""shape""shape"
'stride'"stride""stride""stride""stride""stride" (StrideStrideStrideStridestridestride)
'type'"type""type""type""type""type"
Generic Layer Parameters set get
'bias_filler'"bias_filler""bias_filler""bias_filler""bias_filler""bias_filler"
'bias_filler_const_val'"bias_filler_const_val""bias_filler_const_val""bias_filler_const_val""bias_filler_const_val""bias_filler_const_val"
'bias_filler_variance_norm'"bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm"
'bias_term'"bias_term""bias_term""bias_term""bias_term""bias_term"
'is_inference_output'"is_inference_output""is_inference_output""is_inference_output""is_inference_output""is_inference_output"
'learning_rate_multiplier'"learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier"
'learning_rate_multiplier_bias'"learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias"
'num_trainable_params'"num_trainable_params""num_trainable_params""num_trainable_params""num_trainable_params""num_trainable_params"
'upper_bound'"upper_bound""upper_bound""upper_bound""upper_bound""upper_bound"
'weight_filler'"weight_filler""weight_filler""weight_filler""weight_filler""weight_filler"
'weight_filler_const_val'"weight_filler_const_val""weight_filler_const_val""weight_filler_const_val""weight_filler_const_val""weight_filler_const_val"
'weight_filler_variance_norm'"weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm"

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 output layer.

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

Width and height of the filter kernels.

Default value: 3

DilationDilationDilationDilationdilationdilation (input_control)  number(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Amount of filter dilation for width and height.

Default value: 1

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

Amount of filter shift in width and height direction.

Default value: 1

NumKernelNumKernelNumKernelNumKernelnumKernelnum_kernel (input_control)  number HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of filter kernels.

Default value: 64

GroupsGroupsGroupsGroupsgroupsgroups (input_control)  number HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of filter groups.

Default value: 1

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

Padding type or specific padding size.

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

List of values: [all], [width,height], [left,right,top,bottom], 'half_kernel_size'"half_kernel_size""half_kernel_size""half_kernel_size""half_kernel_size""half_kernel_size", '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"

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

Enable optional ReLU or sigmoid activations.

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

List of values: 'none'"none""none""none""none""none", 'relu'"relu""relu""relu""relu""relu", 'sigmoid'"sigmoid""sigmoid""sigmoid""sigmoid""sigmoid"

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

Generic input parameter names.

Default value: []

List of values: 'bias_filler'"bias_filler""bias_filler""bias_filler""bias_filler""bias_filler", 'bias_filler_const_val'"bias_filler_const_val""bias_filler_const_val""bias_filler_const_val""bias_filler_const_val""bias_filler_const_val", 'bias_filler_variance_norm'"bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm", 'bias_term'"bias_term""bias_term""bias_term""bias_term""bias_term", 'is_inference_output'"is_inference_output""is_inference_output""is_inference_output""is_inference_output""is_inference_output", 'learning_rate_multiplier'"learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier", 'learning_rate_multiplier_bias'"learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias", 'upper_bound'"upper_bound""upper_bound""upper_bound""upper_bound""upper_bound", 'weight_filler'"weight_filler""weight_filler""weight_filler""weight_filler""weight_filler", 'weight_filler_const_val'"weight_filler_const_val""weight_filler_const_val""weight_filler_const_val""weight_filler_const_val""weight_filler_const_val", 'weight_filler_variance_norm'"weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm"

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: 'xavier'"xavier""xavier""xavier""xavier""xavier", 'msra'"msra""msra""msra""msra""msra", 'const'"const""const""const""const""const", 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor", 'bilinear'"bilinear""bilinear""bilinear""bilinear""bilinear", 'norm_in'"norm_in""norm_in""norm_in""norm_in""norm_in", 'norm_out'"norm_out""norm_out""norm_out""norm_out""norm_out", 'norm_average'"norm_average""norm_average""norm_average""norm_average""norm_average", 'true'"true""true""true""true""true", 'false'"false""false""false""false""false", 1.0, 0.9, 0.0

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

Convolutional layer.

References

V. Dumoulin, F. Visin: "A guide to convolution arithmetic for deep learning", 2018, http://arxiv.org/abs/1603.07285

Module

Deep Learning Training