create_dl_layer_permutationT_create_dl_layer_permutationCreateDlLayerPermutationCreateDlLayerPermutationcreate_dl_layer_permutation (Operator)

Name

create_dl_layer_permutationT_create_dl_layer_permutationCreateDlLayerPermutationCreateDlLayerPermutationcreate_dl_layer_permutation — Create a permutation layer.

Signature

create_dl_layer_permutation( : : DLLayerInput, LayerName, Permutation, GenParamName, GenParamValue : DLLayerPermutation)

Herror T_create_dl_layer_permutation(const Htuple DLLayerInput, const Htuple LayerName, const Htuple Permutation, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DLLayerPermutation)

void CreateDlLayerPermutation(const HTuple& DLLayerInput, const HTuple& LayerName, const HTuple& Permutation, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerPermutation)

HDlLayer HDlLayer::CreateDlLayerPermutation(const HString& LayerName, const HTuple& Permutation, const HTuple& GenParamName, const HTuple& GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerPermutation(const HString& LayerName, const HTuple& Permutation, const HString& GenParamName, const HString& GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerPermutation(const char* LayerName, const HTuple& Permutation, const char* GenParamName, const char* GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerPermutation(const wchar_t* LayerName, const HTuple& Permutation, const wchar_t* GenParamName, const wchar_t* GenParamValue) const   (Windows only)

static void HOperatorSet.CreateDlLayerPermutation(HTuple DLLayerInput, HTuple layerName, HTuple permutation, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerPermutation)

HDlLayer HDlLayer.CreateDlLayerPermutation(string layerName, HTuple permutation, HTuple genParamName, HTuple genParamValue)

HDlLayer HDlLayer.CreateDlLayerPermutation(string layerName, HTuple permutation, string genParamName, string genParamValue)

def create_dl_layer_permutation(dllayer_input: HHandle, layer_name: str, permutation: Sequence[int], gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]]) -> HHandle

Description

The operator create_dl_layer_permutationcreate_dl_layer_permutationCreateDlLayerPermutationCreateDlLayerPermutationCreateDlLayerPermutationcreate_dl_layer_permutation creates a permutation layer whose handle is returned in DLLayerPermutationDLLayerPermutationDLLayerPermutationDLLayerPermutationDLLayerPermutationdllayer_permutation.

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 PermutationPermutationPermutationPermutationpermutationpermutation determines the new order of the axes of DLLayerInputDLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input, to which the input axes should be permuted.

PermutationPermutationPermutationPermutationpermutationpermutation has the form [index width, index height, index depth, index batch], where the indices are corresponding to the dimensions of the input. For example, [0, 1, 3, 2] leads to swapping the depth and the batch axes. Therefore, each index must be unique and be taken from the set '{0, 1, 2, 3}'"{0, 1, 2, 3}""{0, 1, 2, 3}""{0, 1, 2, 3}""{0, 1, 2, 3}""{0, 1, 2, 3}".

Using a CPU device, for some values of PermutationPermutationPermutationPermutationpermutationpermutation the internal code can not be optimized which can lead to an increased runtime. In this case, the layer parameter 'fall_back_to_baseline'"fall_back_to_baseline""fall_back_to_baseline""fall_back_to_baseline""fall_back_to_baseline""fall_back_to_baseline" is set to 'true'"true""true""true""true""true".

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"

Certain parameters of layers created using this operator create_dl_layer_permutationcreate_dl_layer_permutationCreateDlLayerPermutationCreateDlLayerPermutationCreateDlLayerPermutationcreate_dl_layer_permutation 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
'fall_back_to_baseline'"fall_back_to_baseline""fall_back_to_baseline""fall_back_to_baseline""fall_back_to_baseline""fall_back_to_baseline"
'input_layer'"input_layer""input_layer""input_layer""input_layer""input_layer" (DLLayerInputDLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input)
'name'"name""name""name""name""name" (LayerNameLayerNameLayerNameLayerNamelayerNamelayer_name)
'permutation'"permutation""permutation""permutation""permutation""permutation" (PermutationPermutationPermutationPermutationpermutationpermutation)
'shape'"shape""shape""shape""shape""shape"
'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 output layer.

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

Order of the permuted axes.

Default value: [0,1,2,3]

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"

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

Permutation layer.

Example (HDevelop)

* Swap the batch and depth axes with a permutation layer.
create_dl_layer_input ('input_a', [1, 1, 4], ['input_type', 'const_val'], \
                       ['constant', 1.0], DLLayerInputA)
create_dl_layer_input ('input_b', [1, 1, 4], ['input_type', 'const_val'], \
                       ['constant', 2.0], DLLayerInputB)
create_dl_layer_concat ([DLLayerInputA, DLLayerInputB], 'concat', 'batch', \
                        [], [], DLLayerConcat)
create_dl_layer_permutation (DLLayerConcat, 'permute', [0,1,3,2], \
                             [], [], DLLayerPermute)
create_dl_layer_depth_max (DLLayerPermute, 'depth_max', 'value', \
                           [], [], _, DLLayerDepthMaxValue)
create_dl_model (DLLayerDepthMaxValue, DLModel)
* The expected output values in DLResultBatch.depth_max are [2.0,2.0,2.0,2.0]
query_available_dl_devices (['runtime'], ['cpu'], DLDeviceHandles)
set_dl_model_param (DLModel, 'device', DLDeviceHandles[0])
apply_dl_model (DLModel, dict{}, [], DLResultBatch)

Possible Predecessors

create_dl_layer_inputcreate_dl_layer_inputCreateDlLayerInputCreateDlLayerInputCreateDlLayerInputcreate_dl_layer_input, create_dl_layer_concatcreate_dl_layer_concatCreateDlLayerConcatCreateDlLayerConcatCreateDlLayerConcatcreate_dl_layer_concat, create_dl_layer_reshapecreate_dl_layer_reshapeCreateDlLayerReshapeCreateDlLayerReshapeCreateDlLayerReshapecreate_dl_layer_reshape

Possible Successors

create_dl_layer_convolutioncreate_dl_layer_convolutionCreateDlLayerConvolutionCreateDlLayerConvolutionCreateDlLayerConvolutioncreate_dl_layer_convolution, create_dl_layer_densecreate_dl_layer_denseCreateDlLayerDenseCreateDlLayerDenseCreateDlLayerDensecreate_dl_layer_dense, create_dl_layer_reshapecreate_dl_layer_reshapeCreateDlLayerReshapeCreateDlLayerReshapeCreateDlLayerReshapecreate_dl_layer_reshape

See also

create_dl_layer_reshapecreate_dl_layer_reshapeCreateDlLayerReshapeCreateDlLayerReshapeCreateDlLayerReshapecreate_dl_layer_reshape

Module

Deep Learning Training