Skip to content

create_dl_layer_reshapeCreateDlLayerReshapeCreateDlLayerReshapecreate_dl_layer_reshapeT_create_dl_layer_reshape🔗

説明🔗

create_dl_layer_reshapeCreateDlLayerReshapeCreateDlLayerReshapecreate_dl_layer_reshapeT_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 )void CreateDlLayerReshape( const HTuple& DLLayerInput, const HTuple& LayerName, const HTuple& Shape, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerReshape )static void HOperatorSet.CreateDlLayerReshape( HTuple DLLayerInput, HTuple layerName, HTuple shape, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerReshape )def create_dl_layer_reshape( dllayer_input: HHandle, layer_name: str, shape: Sequence[int], gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]] ) -> HHandle

Herror T_create_dl_layer_reshape( const Htuple DLLayerInput, const Htuple LayerName, const Htuple Shape, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DLLayerReshape )

HDlLayer HDlLayer::CreateDlLayerReshape( const HString& LayerName, const HTuple& Shape, const HTuple& GenParamName, const HTuple& GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerReshape( const HString& LayerName, const HTuple& Shape, const HString& GenParamName, const HString& GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerReshape( const char* LayerName, const HTuple& Shape, const char* GenParamName, const char* GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerReshape( const wchar_t* LayerName, const HTuple& Shape, const wchar_t* GenParamName, const wchar_t* GenParamValue ) const (Windows only)

HDlLayer HDlLayer.CreateDlLayerReshape( string layerName, HTuple shape, HTuple genParamName, HTuple genParamValue )

HDlLayer HDlLayer.CreateDlLayerReshape( string layerName, HTuple shape, string genParamName, string genParamValue )

説明🔗

create_dl_layer_reshapeCreateDlLayerReshape は、再形成層(Reshape Layer)を生成し、 そのハンドルを DLLayerReshapeDLLayerReshapedllayer_reshape に返します。

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

パラメーター LayerNamelayerNamelayer_name は、個々の層の名前を設定します。 create_dl_modelCreateDlModel によってモデルを生成する場合、 生成されるネットワークの各層には固有の名前が必要です。

パラメーター Shapeshapeshape は、入力データが変換される際の出力形式を設定します。 Shapeshapeshape の値は、[width, height, depth, batch_size] の形式で指定する必要があります。4番目のバッチサイズの値は任意です。

全体のデータサイズは一定でなければいけません。例、 width_out * height_out * depth_out * batch_size_out = width_in * height_in * depth_in * batch_size_in

Shapeshapeshape の値を設定することによって以下のオプションを選択することができます:

  • 4つの次元それぞれに値を設定する。

  • 入力される次元の値を維持するため、1つまたは複数の値を 00 と設定する。

  • 最大1つの値を -1-1 に設定することで、その値が自動的に決定されます。 この値は全体のサイズが一定になるように決定されます。これは計算された値が整数の場合のみ可能です。

create_dl_modelCreateDlModel を使用して作成されたモデルのバッチサイズは set_dl_model_paramSetDlModelParam で常に 設定できるようにしなければなりません。従って、変換層の出力バッチサイズがモデルのバッチサイズと 同じになるように設定する。( Shapeshapeshape のバッチサイズを 00 に設定)、もしくは 少なくとも一つの再形成寸法が自動的に計算されるようになります。 1つの値が -1-1 に設定されています。 バッチサイズが指定されていない場合、値は 00 に設定されます。入力バッチサイズと同じ 出力サイズになります。

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

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

    初期値: 'false'"false"

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

層パラメーター set get
'input_layer'"input_layer" (DLLayerInputDLLayerInputdllayer_input) x
'name'"name" (LayerNamelayerNamelayer_name) x x
'output_depth'"output_depth" (Shapeshapeshape) x
'output_height'"output_height" (Shapeshapeshape) x
'output_layer'"output_layer" (DLLayerReshapeDLLayerReshapedllayer_reshape) x
'output_width'"output_width" (Shapeshapeshape) 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*)

アウトプット層の名前

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

出力グラフ層データの形状

初期値: [224, 224, 3][224, 224, 3]

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

一般パラメーターの名前

初期値: [][]
値のリスト: 'is_inference_output'"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'"true", "false"

DLLayerReshapeDLLayerReshapedllayer_reshape (output_control) dl_layer → (handle)HTuple (HHandle)HDlLayer, HTuple (IntPtr)HHandleHtuple (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)

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

組み合わせ

前処理の候補

create_dl_layer_inputCreateDlLayerInput, create_dl_layer_concatCreateDlLayerConcat

後処理の候補

create_dl_layer_convolutionCreateDlLayerConvolution, create_dl_layer_denseCreateDlLayerDense

モジュール🔗

Deep Learning Professional