create_dl_layer_permutation🔗
説明🔗
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 )
説明🔗
オペレーター create_dl_layer_permutation は順列層を生成します。
そのハンドルを DLLayerPermutation に返します。
パラメータ DLLayerInput は入力層を決定し層ハンドルを値として受け取ります。
パラメータ LayerName は、個々の層の名前を設定します。
create_dl_model によってモデルを生成する場合、生成されるネットワークの各層には一意な名前をつける必要があることに注意してください。
パラメータ Permutation は、順列後にDLLayerInput の軸が並ぶ順序を決定します。
Permutationは、出力順序で指定された軸を列挙した文字列または整数のリストを受け取ります。
例えば['width', 'height', 'batch', 'depth']を指定すると、深度軸とバッチ軸が入れ替わります。
各軸は一意である必要があり、\({[0, 1, 2, 3]}\) または
\({['width', 'height', 'depth', 'batch']}\)から選択する必要があります。
CPUを使用する際、Permutation の値によっては内部コードを最適化することができないため処理時間が長くなります。
この場合、層のパラメータの 'fall_back_to_baseline' を 'true' に設定します。
以下の一般パラメーター GenParamName と対応する値 GenParamValue がサポートされています。
-
'axes_format': 指定された互換性のあるパラメータ
PermutationがWHCN形式(デフォルト)で与えられるか、 NCHW形式で与えられるかを決定します。 このパラメータは、指定された軸の解釈形式を変更します。 例えば、順列 [0, 1, 3, 2] と 'axes_format' 'nchw' を指定した場合、高さと幅が入れ替わります。 'axes_format' が 'whcn' に設定されているか、指定されていない場合、同じ効果を得るために必要な順列は[1, 0, 2, 3]となります。 インデックスの代わりに、文字列を使用して順列を指定することも可能です。値のリスト: 'nchw', 'whcn'
初期値: 'whcn'
-
'is_inference_output':
apply_dl_modelがOutputsとしてこの層を指定していなくても、 ディクショナリDLResultBatchにこの層の出力を含めるか ('true')、 含めないか ('false') を設定します。初期値: 'false'
create_dl_layer_permutationによって生成された層の一部のパラメーターは、
他のオペレーターによって値をセットしたり、取得することができます。
次の表は、どのパラメーターが set_dl_model_layer_param を使って設定でき、
どのパラメーターが get_dl_model_layer_param や get_dl_model_layer_param を使って
取得できるのかについて、概要を示しています。
なお、オペレーター set_dl_model_layer_param と get_dl_model_layer_param には、
create_dl_model で生成されたモデルを必要とします。
| 層パラメーター | set |
get |
|---|---|---|
| 'fall_back_to_baseline' | x |
|
'input_layer' (DLLayerInput) |
x |
|
'name' (LayerName) |
x |
x |
'permutation' (Permutation) |
x |
|
| 'shape' | x |
|
| 'type' | x |
| 汎用層パラメーター | set |
get |
|---|---|---|
| 'is_inference_output' | x |
x |
| 'num_trainable_params' | x |
実行情報🔗
実行情報
-
マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)
-
マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)
-
並列演算処理には未対応
パラメーター🔗
DLLayerInput (input_control) dl_layer → (handle)
入力される層
LayerName (input_control) string → (string)
出力層の名前
Permutation (input_control) number-array → (integer)
軸の順序
初期値: ['batch', 'depth', 'height', 'width']
GenParamName (input_control) attribute.name(-array) → (string)
一般パラメーターの名前
初期値: []
値のリスト: 'axes_format', 'is_inference_output'
GenParamValue (input_control) attribute.value(-array) → (string / integer / real)
一般パラメーターの値
初期値: []
推奨値: 'true', 'false', 'nchw', 'whcn'
DLLayerPermutation (output_control) dl_layer → (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_input, create_dl_layer_concat, create_dl_layer_reshape
後処理の候補
create_dl_layer_convolution, create_dl_layer_dense, create_dl_layer_reshape
関連項目
モジュール🔗
Deep Learning Professional