create_dl_layer_reshape🔗
説明🔗
create_dl_layer_reshape — 再形成層(Reshape Layer)を生成する。
書式🔗
create_dl_layer_reshape( dl_layer DLLayerInput, string LayerName, number Shape, attribute.name GenParamName, attribute.value GenParamValue, out dl_layer DLLayerReshape )
説明🔗
create_dl_layer_reshape は、再形成層(Reshape Layer)を生成し、
そのハンドルを DLLayerReshape に返します。
パラメーター DLLayerInput は、値として層のハンドルを受け取り、入力される層を決定します。
パラメーター LayerName は、個々の層の名前を設定します。
create_dl_model によってモデルを生成する場合、
生成されるネットワークの各層には固有の名前が必要です。
パラメーター Shape は、入力データが変換される際の出力形式を設定します。
Shape の値は、[width, height, depth, batch_size]
の形式で指定する必要があります。4番目のバッチサイズの値は任意です。
全体のデータサイズは一定でなければいけません。例、 width_out *
height_out * depth_out * batch_size_out
= width_in * height_in * depth_in * batch_size_in
Shape の値を設定することによって以下のオプションを選択することができます:
-
4つの次元それぞれに値を設定する。
-
入力される次元の値を維持するため、1つまたは複数の値を 0 と設定する。
-
最大1つの値を -1 に設定することで、その値が自動的に決定されます。 この値は全体のサイズが一定になるように決定されます。これは計算された値が整数の場合のみ可能です。
create_dl_model を使用して作成されたモデルのバッチサイズは set_dl_model_param で常に
設定できるようにしなければなりません。従って、変換層の出力バッチサイズがモデルのバッチサイズと
同じになるように設定する。( Shape のバッチサイズを 0 に設定)、もしくは
少なくとも一つの再形成寸法が自動的に計算されるようになります。
1つの値が -1 に設定されています。
バッチサイズが指定されていない場合、値は 0 に設定されます。入力バッチサイズと同じ
出力サイズになります。
以下の一般パラメーター GenParamName と、対応する値 GenParamValue がサポートされています。
-
'is_inference_output':
apply_dl_modelがOutputsとしてこの層を指定していなくても、 ディクショナリDLResultBatchにこの層の出力を含めるか ('true')、 含めないか ('false') を設定します。初期値: 'false'
create_dl_layer_reshape によって生成された層の一部のパラメーターは、
他のオペレーターによって値をセットしたり、取得することができます。
次の表は、どのパラメーターが set_dl_model_layer_param を使って設定でき、
どのパラメーターが get_dl_model_layer_param や get_dl_layer_param を使って
取得できるのか、概要を示しています。
なお、オペレーター set_dl_model_layer_param と get_dl_model_layer_param には、
create_dl_model で生成されたモデルを要求します。
| 層パラメーター | set |
get |
|---|---|---|
'input_layer' (DLLayerInput) |
x |
|
'name' (LayerName) |
x |
x |
'output_depth' (Shape) |
x |
|
'output_height' (Shape) |
x |
|
'output_layer' (DLLayerReshape) |
x |
|
'output_width' (Shape) |
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)
アウトプット層の名前
Shape (input_control) number-array → (integer)
出力グラフ層データの形状
初期値: [224, 224, 3]
GenParamName (input_control) attribute.name(-array) → (string)
一般パラメーターの名前
初期値: []
値のリスト: 'is_inference_output'
GenParamValue (input_control) attribute.value(-array) → (string / integer / real)
一般パラメーターの値
初期値: []
推奨値: 'true', 'false'
DLLayerReshape (output_control) dl_layer → (handle)
再形成層(Reshape Layer)
例🔗
(HDevelop)
* Minimal example for reshape-layer.
create_dl_layer_input ('input', [64, 32, 10], [], [], DLLayerInput)
create_dl_layer_reshape (DLLayerInput, 'reshape_wh', [32, 64, 0], [], [], \
DLLayerReshapeWH)
create_dl_layer_reshape (DLLayerInput, 'reshape_bs', [64, 32, 1, -1], [], \
[], DLLayerReshapeBS)
* DLLayerReshapeBS has batch size 10 and depth 1.
get_dl_layer_param (DLLayerReshapeBS, 'shape', ShapeReshapeBS)
* Create a model and change the batch-size.
create_dl_model (DLLayerReshapeBS, DLModel)
set_dl_model_param (DLModel, 'batch_size', 2)
* DLLayerReshapeBS has batch size 20 now.
get_dl_model_layer_param (DLModel, 'reshape_bs', 'shape', ShapeReshapeBS)
他のオペレーターとの組み合わせ🔗
モジュール🔗
Deep Learning Professional