Skip to content

create_dl_layer_permutationCreateDlLayerPermutationCreateDlLayerPermutationcreate_dl_layer_permutationT_create_dl_layer_permutation🔗

説明🔗

create_dl_layer_permutationCreateDlLayerPermutationCreateDlLayerPermutationcreate_dl_layer_permutationT_create_dl_layer_permutation — 順列層を生成する

書式🔗

create_dl_layer_permutation( dl_layer DLLayerInput, string LayerName, number Permutation, attribute.name GenParamName, attribute.value GenParamValue, out dl_layer DLLayerPermutation )void CreateDlLayerPermutation( const HTuple& DLLayerInput, const HTuple& LayerName, const HTuple& Permutation, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerPermutation )static void HOperatorSet.CreateDlLayerPermutation( HTuple DLLayerInput, HTuple layerName, HTuple permutation, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerPermutation )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

Herror T_create_dl_layer_permutation( 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)

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

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

説明🔗

オペレーター create_dl_layer_permutationCreateDlLayerPermutation は順列層を生成します。 そのハンドルを DLLayerPermutationDLLayerPermutationdllayer_permutation に返します。

パラメータ DLLayerInputDLLayerInputdllayer_input は入力層を決定し層ハンドルを値として受け取ります。

パラメータ LayerNamelayerNamelayer_name は、個々の層の名前を設定します。 create_dl_modelCreateDlModel によってモデルを生成する場合、生成されるネットワークの各層には一意な名前をつける必要があることに注意してください。 パラメータ Permutationpermutationpermutation は、順列後にDLLayerInputDLLayerInputdllayer_input の軸が並ぶ順序を決定します。 Permutationpermutationpermutationは、出力順序で指定された軸を列挙した文字列または整数のリストを受け取ります。 例えば['width', 'height', 'batch', 'depth']["width", "height", "batch", "depth"]を指定すると、深度軸とバッチ軸が入れ替わります。 各軸は一意である必要があり、\({[0, 1, 2, 3]}\) または \({['width', 'height', 'depth', 'batch']}\)から選択する必要があります。

CPUを使用する際、Permutationpermutationpermutation の値によっては内部コードを最適化することができないため処理時間が長くなります。 この場合、層のパラメータの 'fall_back_to_baseline'"fall_back_to_baseline" を 'true'"true" に設定します。

以下の一般パラメーター GenParamNamegenParamNamegen_param_name と対応する値 GenParamValuegenParamValuegen_param_value がサポートされています。

  • 'axes_format'"axes_format": 指定された互換性のあるパラメータ Permutationpermutationpermutation がWHCN形式(デフォルト)で与えられるか、 NCHW形式で与えられるかを決定します。 このパラメータは、指定された軸の解釈形式を変更します。 例えば、順列 [0, 1, 3, 2][0, 1, 3, 2] と 'axes_format'"axes_format" 'nchw'"nchw" を指定した場合、高さと幅が入れ替わります。 'axes_format'"axes_format" が 'whcn'"whcn" に設定されているか、指定されていない場合、同じ効果を得るために必要な順列は[1, 0, 2, 3][1, 0, 2, 3]となります。 インデックスの代わりに、文字列を使用して順列を指定することも可能です。

    値のリスト: 'nchw'"nchw", 'whcn'"whcn"

    初期値: 'whcn'"whcn"

  • 'is_inference_output'"is_inference_output": apply_dl_modelApplyDlModel が Outputsoutputsoutputs としてこの層を指定していなくても、 ディクショナリ DLResultBatchDLResultBatchdlresult_batch にこの層の出力を含めるか ('true'"true")、 含めないか ('false'"false") を設定します。

    初期値: 'false'"false"

create_dl_layer_permutationCreateDlLayerPermutationによって生成された層の一部のパラメーターは、 他のオペレーターによって値をセットしたり、取得することができます。 次の表は、どのパラメーターが set_dl_model_layer_paramSetDlModelLayerParam を使って設定でき、 どのパラメーターが get_dl_model_layer_paramGetDlModelLayerParam や get_dl_model_layer_paramGetDlModelLayerParam を使って 取得できるのかについて、概要を示しています。 なお、オペレーター set_dl_model_layer_paramSetDlModelLayerParam と get_dl_model_layer_paramGetDlModelLayerParam には、 create_dl_modelCreateDlModel で生成されたモデルを必要とします。

層パラメーター set get
'fall_back_to_baseline'"fall_back_to_baseline" x
'input_layer'"input_layer" (DLLayerInputDLLayerInputdllayer_input) x
'name'"name" (LayerNamelayerNamelayer_name) x x
'permutation'"permutation" (Permutationpermutationpermutation) x
'shape'"shape" x
'type'"type" x
汎用層パラメーター set get
'is_inference_output'"is_inference_output" x x
'num_trainable_params'"num_trainable_params" x

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • 並列演算処理には未対応

パラメーター🔗

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

入力される層

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

出力層の名前

Permutationpermutationpermutation (input_control) number-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

軸の順序

初期値: ['batch', 'depth', 'height', 'width']["batch", "depth", "height", "width"]

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

一般パラメーターの名前

初期値: [][]
値のリスト: 'axes_format', 'is_inference_output'"axes_format", "is_inference_output"

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)

一般パラメーターの値

初期値: [][]
推奨値: 'true', 'false', 'nchw', 'whcn'"true", "false", "nchw", "whcn"

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

順列層

例🔗

(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', ['width','height','batch','depth'], \
                             [], [], 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)

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

create_dl_layer_inputCreateDlLayerInput, create_dl_layer_concatCreateDlLayerConcat, create_dl_layer_reshapeCreateDlLayerReshape

後処理の候補

create_dl_layer_convolutionCreateDlLayerConvolution, create_dl_layer_denseCreateDlLayerDense, create_dl_layer_reshapeCreateDlLayerReshape

関連項目

create_dl_layer_reshapeCreateDlLayerReshape

モジュール🔗

Deep Learning Professional