create_dl_layer_reduce🔗
説明🔗
create_dl_layer_reduce — reduceレイヤーを作成する。
書式🔗
create_dl_layer_reduce( dl_layer DLLayerInput, string LayerName, string Operation, integer Axes, attribute.name GenParamName, attribute.value GenParamValue, out dl_layer DLLayerReduce )
説明🔗
オペレータ create_dl_layer_reduce はreduceレイヤーを作成し、
そのハンドルは DLLayerReduce に返されます。
reduceレイヤーは与えられた入力テンソルを1つまたは複数の軸に沿って1つの値に削減します。
それゆえ、出力テンソルは入力テンソルとして同じ形状を持ちますが、
Axes で与えられる軸では、次元が1になります。
パラメータ DLLayerInput は入力として与えられるレイヤーを決定します。
このレイヤーは入力として1つのレイヤーを想定しています。
パラメータ LayerName は個々のレイヤーの名前を設定します。
ただし、 create_dl_model を使用してモデルを作成する場合、
作成されたネットワークの各レイヤーは独自の名前を持つ必要があります。
パラメータ Operation は適用される操作を指定します。
操作は、入力テンソルの Axes で指定された軸に沿った値に適用され、
結果は、出力テンソルの対応する位置に書き込まれます。
Operationは次の値がサポートされています。:
-
'norm_l2': 入力値のL2ノルムを計算します。
-
'sum': 入力値の合計を計算します。
次の汎用パラメータ GenParamName及び対応する値 GenParamValueがサポートされています。:
-
'is_inference_output': オペレータ
apply_dl_modelがOutputsでこのレイヤーを 指定していない場合であっても、ディクショナリDLResultBatchに、 このレイヤーの出力を含む('true')か、含まない('false')かを決定します。 初期値: 'false' -
'div_eps': 学習を安定させるために使用される小さなスカラ値です。 ゼロ除算を防ぐために分母にこの値が加えられます。 初期値: 1e-10
このオペレータ create_dl_layer_reduce を使用して作成されたレイヤーの特定のパラメータは、
追加のオペレータを用いて設定や取得が可能です。
以下の表は 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 |
|---|---|---|
'axes' (Axes) |
x |
|
'input_layer' (DLLayerInput) |
x |
|
'name' (LayerName) |
x |
x |
'operation' (Operation) |
x |
|
'output_layer' (DLLayerReduce) |
x |
|
| 'shape' | x |
|
| 'type' | x |
| 汎用レイヤーパラメータ | set |
get |
|---|---|---|
| 'is_inference_output' | x |
x |
| 'num_trainable_params' | x |
|
| 'div_eps' | x |
実行情報🔗
実行情報
-
マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)
-
マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)
-
並列演算処理には未対応
パラメーター🔗
DLLayerInput (input_control) dl_layer → (handle)
与えられる入力レイヤー
LayerName (input_control) string → (string)
出力レイヤーの名前
Operation (input_control) string → (string)
Reduce演算.
初期値: 'norm_l2'
値のリスト: 'norm_l2', 'sum'
Axes (input_control) integer(-array) → (integer / string)
Reduce演算が適用される軸
初期値: [2, 3]
値のリスト: 0, 1, 2, 3, 'batch', 'depth', 'height', 'width'
GenParamName (input_control) attribute.name(-array) → (string)
汎用パラメータの名前
初期値: []
値のリスト: 'div_eps', 'is_inference_output'
GenParamValue (input_control) attribute.value(-array) → (string / integer / real)
汎用パラメータの値
初期値: []
推奨値: 1e-10, 'true', 'false'
DLLayerReduce (output_control) dl_layer → (handle)
Reduceレイヤー
例🔗
(HDevelop)
* Minimal example for reduce-layer.
create_dl_layer_input ('input', [64, 32, 10], [], [], DLLayerInput)
create_dl_layer_reduce (DLLayerInput, 'reduce_width', 'sum', 'width', [], [], \
DLLayerReduceWidth)
create_dl_layer_reduce (DLLayerReduceWidth, 'reduce_height_depth', 'norm_l2', [1,2], [], \
[], DLLayerReduceHeightDepth)
* Create a model and change the batch-size.
create_dl_model (DLLayerReduceHeightDepth, DLModel)
set_dl_model_param (DLModel, 'batch_size', 2)
get_dl_model_layer_param (DLModel, 'reduce_height_depth', 'shape', ShapeReduceHeightWidth)
他のオペレーターとの組み合わせ🔗
モジュール🔗
Deep Learning Professional