create_dl_layer_transposed_convolutionT_create_dl_layer_transposed_convolutionCreateDlLayerTransposedConvolutionCreateDlLayerTransposedConvolutioncreate_dl_layer_transposed_convolution (Operator)

Name

create_dl_layer_transposed_convolutionT_create_dl_layer_transposed_convolutionCreateDlLayerTransposedConvolutionCreateDlLayerTransposedConvolutioncreate_dl_layer_transposed_convolution — Create a transposed convolution layer.

Signature

create_dl_layer_transposed_convolution( : : DLLayerInput, LayerName, KernelSize, Stride, KernelDepth, Groups, Padding, GenParamName, GenParamValue : DLLayerTransposedConvolution)

Herror T_create_dl_layer_transposed_convolution(const Htuple DLLayerInput, const Htuple LayerName, const Htuple KernelSize, const Htuple Stride, const Htuple KernelDepth, const Htuple Groups, const Htuple Padding, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DLLayerTransposedConvolution)

void CreateDlLayerTransposedConvolution(const HTuple& DLLayerInput, const HTuple& LayerName, const HTuple& KernelSize, const HTuple& Stride, const HTuple& KernelDepth, const HTuple& Groups, const HTuple& Padding, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerTransposedConvolution)

HDlLayer HDlLayer::CreateDlLayerTransposedConvolution(const HString& LayerName, Hlong KernelSize, Hlong Stride, Hlong KernelDepth, Hlong Groups, const HTuple& Padding, const HTuple& GenParamName, const HTuple& GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerTransposedConvolution(const HString& LayerName, Hlong KernelSize, Hlong Stride, Hlong KernelDepth, Hlong Groups, const HString& Padding, const HString& GenParamName, const HString& GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerTransposedConvolution(const char* LayerName, Hlong KernelSize, Hlong Stride, Hlong KernelDepth, Hlong Groups, const char* Padding, const char* GenParamName, const char* GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerTransposedConvolution(const wchar_t* LayerName, Hlong KernelSize, Hlong Stride, Hlong KernelDepth, Hlong Groups, const wchar_t* Padding, const wchar_t* GenParamName, const wchar_t* GenParamValue) const   ( Windows only)

static void HOperatorSet.CreateDlLayerTransposedConvolution(HTuple DLLayerInput, HTuple layerName, HTuple kernelSize, HTuple stride, HTuple kernelDepth, HTuple groups, HTuple padding, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerTransposedConvolution)

HDlLayer HDlLayer.CreateDlLayerTransposedConvolution(string layerName, int kernelSize, int stride, int kernelDepth, int groups, HTuple padding, HTuple genParamName, HTuple genParamValue)

HDlLayer HDlLayer.CreateDlLayerTransposedConvolution(string layerName, int kernelSize, int stride, int kernelDepth, int groups, string padding, string genParamName, string genParamValue)

def create_dl_layer_transposed_convolution(dllayer_input: HHandle, layer_name: str, kernel_size: int, stride: int, kernel_depth: int, groups: int, padding: MaybeSequence[Union[str, int]], gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]]) -> HHandle

Description

The operator create_dl_layer_transposed_convolutioncreate_dl_layer_transposed_convolutionCreateDlLayerTransposedConvolutionCreateDlLayerTransposedConvolutioncreate_dl_layer_transposed_convolution creates a transposed convolution layer whose handle is returned in DLLayerTransposedConvolutionDLLayerTransposedConvolutionDLLayerTransposedConvolutionDLLayerTransposedConvolutiondllayer_transposed_convolution.

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

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

The parameter KernelSizeKernelSizeKernelSizekernelSizekernel_size specifies the filter kernel in the dimensions width and height. So far, only quadratic kernels are supported.

Restriction: This value must be a tuple of length 1.

The parameter StrideStrideStridestridestride determines how the filter is shifted in row and column direction.

Restriction: This value must be a tuple of length 1.

The parameter KernelDepthKernelDepthKernelDepthkernelDepthkernel_depth defines the depth of the output feature maps.

Restriction: This value must be a tuple of length 1.

The parameter GroupsGroupsGroupsgroupsgroups determines the amount of filter groups. So far, only a single filter group is supported.

Restriction: This value must be a tuple of length 1.

The parameter PaddingPaddingPaddingpaddingpadding effectively appends pixels with value 0 to each border of the input. This is set so that a convolutional layer and a transposed convolution layer with the same KernelSizeKernelSizeKernelSizekernelSizekernel_size, StrideStrideStridestridestride and PaddingPaddingPaddingpaddingpadding values are inverses of each other regarding their input and output shapes. Supported PaddingPaddingPaddingpaddingpadding values are:

The following generic parameters GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and the corresponding values GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value are supported:

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

Determines, whether the layer has bias terms.

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

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

Determines whether apply_dl_modelapply_dl_modelApplyDlModelApplyDlModelapply_dl_model will include the output of this layer in the dictionary DLResultBatchDLResultBatchDLResultBatchDLResultBatchdlresult_batch even without specifying this layer in OutputsOutputsOutputsoutputsoutputs ('true'"true""true""true""true") or not ('false'"false""false""false""false").

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

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

Learning rate multiplier for this layer that is used during training. If '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

'output_padding'"output_padding""output_padding""output_padding""output_padding":

Can be used to resolve ambiguities in the output shape for KernelSizeKernelSizeKernelSizekernelSizekernel_size and StrideStrideStridestridestride larger than 1. As mentioned above in the description of the parameter PaddingPaddingPaddingpaddingpadding, with respect to the input and output shapes a transposed convolution layer can be seen as the inverse of a convolution layer if they have the same settings for KernelSizeKernelSizeKernelSizekernelSizekernel_size, StrideStrideStridestridestride, and PaddingPaddingPaddingpaddingpadding (and dilation). However, a convolution layer can map several shapes to the same output spatial dimensions. E.g., for KernelSizeKernelSizeKernelSizekernelSizekernel_size 3, PaddingPaddingPaddingpaddingpadding 1, and StrideStrideStridestridestride 2, both inputs with spatial dimensions (H, W) = '(4, 4)'"(4, 4)""(4, 4)""(4, 4)""(4, 4)" and (H, W) = '(3, 3)'"(3, 3)""(3, 3)""(3, 3)""(3, 3)" are mapped to an output shape with (H, W) = '(2, 2)'"(2, 2)""(2, 2)""(2, 2)""(2, 2)". To get back to '(4, 4)'"(4, 4)""(4, 4)""(4, 4)""(4, 4)" using a transposed convolution (with the same settings for KernelSizeKernelSizeKernelSizekernelSizekernel_size, StrideStrideStridestridestride, and PaddingPaddingPaddingpaddingpadding) 'output_padding'"output_padding""output_padding""output_padding""output_padding" must be set to 1. 'output_padding'"output_padding""output_padding""output_padding""output_padding" must not be larger than the bottom and right PaddingPaddingPaddingpaddingpadding and can only be set larger than 0 if StrideStrideStridestridestride is larger than 1.

Default: 0

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

Defines the mode how the weights are initialized. See create_dl_layer_convolutioncreate_dl_layer_convolutionCreateDlLayerConvolutionCreateDlLayerConvolutioncreate_dl_layer_convolution for a detailed explanation of this parameter and its values.

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

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

See create_dl_layer_convolutioncreate_dl_layer_convolutionCreateDlLayerConvolutionCreateDlLayerConvolutioncreate_dl_layer_convolution for a detailed explanation of this parameter and its values.

Default: 0.5

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

Value range for 'weight_filler'"weight_filler""weight_filler""weight_filler""weight_filler". See create_dl_layer_convolutioncreate_dl_layer_convolutionCreateDlLayerConvolutionCreateDlLayerConvolutioncreate_dl_layer_convolution for a detailed explanation of this parameter and its values.

List of values: 'norm_average'"norm_average""norm_average""norm_average""norm_average", 'norm_in'"norm_in""norm_in""norm_in""norm_in", 'norm_out'"norm_out""norm_out""norm_out""norm_out", constant value (in combination with 'weight_filler'"weight_filler""weight_filler""weight_filler""weight_filler" = 'msra'"msra""msra""msra""msra")

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

Certain parameters of layers created using this operator create_dl_layer_transposed_convolutioncreate_dl_layer_transposed_convolutionCreateDlLayerTransposedConvolutionCreateDlLayerTransposedConvolutioncreate_dl_layer_transposed_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_paramSetDlModelLayerParamSetDlModelLayerParamset_dl_model_layer_param and which ones can be retrieved using get_dl_model_layer_paramget_dl_model_layer_paramGetDlModelLayerParamGetDlModelLayerParamget_dl_model_layer_param or get_dl_layer_paramget_dl_layer_paramGetDlLayerParamGetDlLayerParamget_dl_layer_param. Note, the operators set_dl_model_layer_paramset_dl_model_layer_paramSetDlModelLayerParamSetDlModelLayerParamset_dl_model_layer_param and get_dl_model_layer_paramget_dl_model_layer_paramGetDlModelLayerParamGetDlModelLayerParamget_dl_model_layer_param require a model created by create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelcreate_dl_model.

Layer Parameters set get
'groups'"groups""groups""groups""groups" (GroupsGroupsGroupsgroupsgroups) x
'input_depth'"input_depth""input_depth""input_depth""input_depth" x
'input_layer'"input_layer""input_layer""input_layer""input_layer" (DLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input) x
'kernel_depth'"kernel_depth""kernel_depth""kernel_depth""kernel_depth" (KernelDepthKernelDepthKernelDepthkernelDepthkernel_depth) x
'kernel_size'"kernel_size""kernel_size""kernel_size""kernel_size" (KernelSizeKernelSizeKernelSizekernelSizekernel_size) x
'name'"name""name""name""name" (LayerNameLayerNameLayerNamelayerNamelayer_name) x x
'output_layer'"output_layer""output_layer""output_layer""output_layer" (DLLayerTransposedConvolutionDLLayerTransposedConvolutionDLLayerTransposedConvolutionDLLayerTransposedConvolutiondllayer_transposed_convolution) x
'padding_type'"padding_type""padding_type""padding_type""padding_type" (PaddingPaddingPaddingpaddingpadding) x
'shape'"shape""shape""shape""shape" x
'stride'"stride""stride""stride""stride" (StrideStrideStridestridestride) x
'type'"type""type""type""type" x
Generic Layer Parameters set get
'bias_term'"bias_term""bias_term""bias_term""bias_term" x
'is_inference_output'"is_inference_output""is_inference_output""is_inference_output""is_inference_output" x x
'learning_rate_multiplier'"learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier" x x
'num_trainable_params'"num_trainable_params""num_trainable_params""num_trainable_params""num_trainable_params" x
'output_padding'"output_padding""output_padding""output_padding""output_padding" x
'weight_filler'"weight_filler""weight_filler""weight_filler""weight_filler" x x
'weight_filler_const_val'"weight_filler_const_val""weight_filler_const_val""weight_filler_const_val""weight_filler_const_val" x x
'weight_filler_variance_norm'"weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm" x x

Execution Information

Parameters

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

Feeding layer.

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

Name of the output layer.

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

Width and height of the filter kernels.

Default: 3

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

Amount of filter shift.

Default: 1

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

Depth of filter kernels.

Default: 64

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

Number of filter groups.

Default: 1

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

Type of the padding.

Default: '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", 'none'"none""none""none""none"

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

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

Generic input parameter names.

Default: []

List of values: '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", 'learning_rate_multiplier'"learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier", 'output_padding'"output_padding""output_padding""output_padding""output_padding", '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_variance_norm'"weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm"

GenParamValueGenParamValueGenParamValuegenParamValuegen_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: []

Suggested values: 'xavier'"xavier""xavier""xavier""xavier", 'msra'"msra""msra""msra""msra", 'const'"const""const""const""const", 'norm_in'"norm_in""norm_in""norm_in""norm_in", 'norm_out'"norm_out""norm_out""norm_out""norm_out", 'norm_average'"norm_average""norm_average""norm_average""norm_average", 'true'"true""true""true""true", 'false'"false""false""false""false"

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

Transposed convolutional layer.

Module

Deep Learning Training