Skip to content

create_dl_layer_transposed_convolutionCreateDlLayerTransposedConvolutionCreateDlLayerTransposedConvolutioncreate_dl_layer_transposed_convolutionT_create_dl_layer_transposed_convolution🔗

Short description🔗

create_dl_layer_transposed_convolutionCreateDlLayerTransposedConvolutionCreateDlLayerTransposedConvolutioncreate_dl_layer_transposed_convolutionT_create_dl_layer_transposed_convolution — Create a transposed convolution layer.

Signature🔗

create_dl_layer_transposed_convolution( dl_layer DLLayerInput, string LayerName, number KernelSize, number Stride, number KernelDepth, number Groups, number Padding, attribute.name GenParamName, attribute.value GenParamValue, out dl_layer 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 )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 )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

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 )

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)

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 )

Description🔗

The operator create_dl_layer_transposed_convolutionCreateDlLayerTransposedConvolution creates a transposed convolution layer whose handle is returned in DLLayerTransposedConvolutionDLLayerTransposedConvolutiondllayer_transposed_convolution.

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

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

The parameter KernelSizekernelSizekernel_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 Stridestridestride determines how the filter is shifted in row and column direction.

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

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

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

The parameter Groupsgroupsgroups 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 Paddingpaddingpadding effectively appends \(\textrm{KernelSize} - 1 - \textrm{Padding}\) 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 KernelSizekernelSizekernel_size, Stridestridestride and Paddingpaddingpadding values are inverses of each other regarding their input and output shapes. Supported Paddingpaddingpadding values are:

  • 'half_kernel_size'"half_kernel_size": The integer value of \(\textrm{Padding}\) in the formula above depends on the specified KernelSizekernelSizekernel_size. More precisely, it is calculated as \(\lfloor\textrm{KernelSize} /2 \rfloor\).

  • 'none'"none": The value of \(\textrm{Padding}\) in the formula above is 0.

  • Number of pixels: Specify the integer value of \(\textrm{Padding}\) in the formula above for each border. To do so, the following tuple lengths are supported:

    • Single number: \(\textrm{Padding}\) value for all four directions left/right/top/bottom.

    • Two numbers: \(\textrm{Padding}\) value for left/right and top/bottom: [l/r, t/b].

    • Four numbers: \(\textrm{Padding}\) value for left, right, top, bottom side: [l,r,t,b].

      Restriction: 'runtime'"runtime" 'gpu'"gpu" does not support asymmetric padding, i.e., the padding values for the left and right side must be equal, as well as the padding values for the top and bottom side.

    Restriction: The integer padding values must be smaller than the value set for KernelSizekernelSizekernel_size.

The following generic parameters GenParamNamegenParamNamegen_param_name and the corresponding values GenParamValuegenParamValuegen_param_value are supported:

  • 'bias_term'"bias_term": Determines, whether the layer has bias terms.

    Default: 'true'"true"

  • 'is_inference_output'"is_inference_output": Determines whether apply_dl_modelApplyDlModel will include the output of this layer in the dictionary DLResultBatchDLResultBatchdlresult_batch even without specifying this layer in Outputsoutputsoutputs ('true'"true") or not ('false'"false").

    Default: 'false'"false"

  • 'learning_rate_multiplier'"learning_rate_multiplier": Learning rate multiplier for this layer that is used during training. If 'learning_rate_multiplier'"learning_rate_multiplier" is set to 0.00.0, the layer is skipped during training.

    Default: 1.01.0

  • 'output_padding'"output_padding": Can be used to resolve ambiguities in the output shape for KernelSizekernelSizekernel_size and Stridestridestride larger than 11. As mentioned above in the description of the parameter Paddingpaddingpadding, 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 KernelSizekernelSizekernel_size, Stridestridestride, and Paddingpaddingpadding (and dilation). However, a convolution layer can map several shapes to the same output spatial dimensions. E.g., for KernelSizekernelSizekernel_size 33, Paddingpaddingpadding 11, and Stridestridestride 22, both inputs with spatial dimensions (H, W) = '(4, 4)'"(4, 4)" and (H, W) = '(3, 3)'"(3, 3)" are mapped to an output shape with (H, W) = '(2, 2)'"(2, 2)". To get back to '(4, 4)'"(4, 4)" using a transposed convolution (with the same settings for KernelSizekernelSizekernel_size, Stridestridestride, and Paddingpaddingpadding) 'output_padding'"output_padding" must be set to 11. 'output_padding'"output_padding" must not be larger than the bottom and right Paddingpaddingpadding and can only be set larger than 00 if Stridestridestride is larger than 11.

    Default: 00

  • 'weight_filler'"weight_filler": Defines the mode how the weights are initialized. See create_dl_layer_convolutionCreateDlLayerConvolution for a detailed explanation of this parameter and its values.

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

    Default: 'xavier'"xavier"

  • 'weight_filler_const_val'"weight_filler_const_val": See create_dl_layer_convolutionCreateDlLayerConvolution for a detailed explanation of this parameter and its values.

    Default: 0.50.5

  • 'weight_filler_variance_norm'"weight_filler_variance_norm": Value range for 'weight_filler'"weight_filler". See create_dl_layer_convolutionCreateDlLayerConvolution for a detailed explanation of this parameter and its values.

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

    Default: 'norm_in'"norm_in"

Certain parameters of layers created using this operator create_dl_layer_transposed_convolutionCreateDlLayerTransposedConvolution can be set and retrieved using further operators. The following tables give an overview, which parameters can be set using set_dl_model_layer_paramSetDlModelLayerParam and which ones can be retrieved using get_dl_model_layer_paramGetDlModelLayerParam or get_dl_layer_paramGetDlLayerParam. Note, the operators set_dl_model_layer_paramSetDlModelLayerParam and get_dl_model_layer_paramGetDlModelLayerParam require a model created by create_dl_modelCreateDlModel.

Layer Parameters set get
'groups'"groups" (Groupsgroupsgroups) x
'input_depth'"input_depth" x
'input_layer'"input_layer" (DLLayerInputDLLayerInputdllayer_input) x
'kernel_depth'"kernel_depth" (KernelDepthkernelDepthkernel_depth) x
'kernel_size'"kernel_size" (KernelSizekernelSizekernel_size) x
'name'"name" (LayerNamelayerNamelayer_name) x x
'output_layer'"output_layer" (DLLayerTransposedConvolutionDLLayerTransposedConvolutiondllayer_transposed_convolution) x
'padding_type'"padding_type" (Paddingpaddingpadding) x
'shape'"shape" x
'stride'"stride" (Stridestridestride) x
'type'"type" x
Generic Layer Parameters set get
'bias_term'"bias_term" x
'is_inference_output'"is_inference_output" x x
'learning_rate_multiplier'"learning_rate_multiplier" x x
'num_trainable_params'"num_trainable_params" x
'output_padding'"output_padding" x
'weight_filler'"weight_filler" x x
'weight_filler_const_val'"weight_filler_const_val" x x
'weight_filler_variance_norm'"weight_filler_variance_norm" x x

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

DLLayerInputDLLayerInputdllayer_input (input_control) dl_layer → (handle)HTuple (HHandle)HDlLayer, HTuple (IntPtr)HHandleHtuple (handle)

Feeding layer.

LayerNamelayerNamelayer_name (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Name of the output layer.

KernelSizekernelSizekernel_size (input_control) number → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width and height of the filter kernels.

Default: 33

Stridestridestride (input_control) number → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Amount of filter shift.

Default: 11

KernelDepthkernelDepthkernel_depth (input_control) number → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Depth of filter kernels.

Default: 6464

Groupsgroupsgroups (input_control) number → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of filter groups.

Default: 11

Paddingpaddingpadding (input_control) number(-array) → (string / integer)HTuple (HString / Hlong)HTuple (string / int / long)MaybeSequence[Union[str, int]]Htuple (char* / Hlong)

Type of the padding.

Default: 'none'"none"
List of values: [all], [width, height], [left, right, top, bottom], 'half_kernel_size', 'none'[all], [width, height], [left, right, top, bottom], "half_kernel_size", "none"
Suggested values: 'none', 'half_kernel_size'"none", "half_kernel_size"

GenParamNamegenParamNamegen_param_name (input_control) attribute.name(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

Generic input parameter names.

Default: [][]
List of values: 'bias_term', 'is_inference_output', 'learning_rate_multiplier', 'output_padding', 'weight_filler', 'weight_filler_const_val', 'weight_filler_variance_norm'"bias_term", "is_inference_output", "learning_rate_multiplier", "output_padding", "weight_filler", "weight_filler_const_val", "weight_filler_variance_norm"

GenParamValuegenParamValuegen_param_value (input_control) attribute.value(-array) → (string / integer / real)HTuple (HString / Hlong / double)HTuple (string / int / long / double)MaybeSequence[Union[int, float, str]]Htuple (char* / Hlong / double)

Generic input parameter values.

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

DLLayerTransposedConvolutionDLLayerTransposedConvolutiondllayer_transposed_convolution (output_control) dl_layer → (handle)HTuple (HHandle)HDlLayer, HTuple (IntPtr)HHandleHtuple (handle)

Transposed convolutional layer.

Module🔗

Deep Learning Professional