create_dl_layer_reduceT_create_dl_layer_reduceCreateDlLayerReduceCreateDlLayerReducecreate_dl_layer_reduce (Operator)

Name

create_dl_layer_reduceT_create_dl_layer_reduceCreateDlLayerReduceCreateDlLayerReducecreate_dl_layer_reduce — Erstellen eines Reduce-Layers.

Signatur

create_dl_layer_reduce( : : DLLayerInput, LayerName, Operation, Axes, GenParamName, GenParamValue : DLLayerReduce)

Herror T_create_dl_layer_reduce(const Htuple DLLayerInput, const Htuple LayerName, const Htuple Operation, const Htuple Axes, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DLLayerReduce)

void CreateDlLayerReduce(const HTuple& DLLayerInput, const HTuple& LayerName, const HTuple& Operation, const HTuple& Axes, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerReduce)

HDlLayer HDlLayer::CreateDlLayerReduce(const HString& LayerName, const HString& Operation, const HTuple& Axes, const HTuple& GenParamName, const HTuple& GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerReduce(const HString& LayerName, const HString& Operation, Hlong Axes, const HString& GenParamName, const HString& GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerReduce(const char* LayerName, const char* Operation, Hlong Axes, const char* GenParamName, const char* GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerReduce(const wchar_t* LayerName, const wchar_t* Operation, Hlong Axes, const wchar_t* GenParamName, const wchar_t* GenParamValue) const   ( Nur Windows)

static void HOperatorSet.CreateDlLayerReduce(HTuple DLLayerInput, HTuple layerName, HTuple operation, HTuple axes, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerReduce)

HDlLayer HDlLayer.CreateDlLayerReduce(string layerName, string operation, HTuple axes, HTuple genParamName, HTuple genParamValue)

HDlLayer HDlLayer.CreateDlLayerReduce(string layerName, string operation, int axes, string genParamName, string genParamValue)

def create_dl_layer_reduce(dllayer_input: HHandle, layer_name: str, operation: str, axes: MaybeSequence[Union[int, str]], gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]]) -> HHandle

Beschreibung

Der Operator create_dl_layer_reducecreate_dl_layer_reduceCreateDlLayerReduceCreateDlLayerReducecreate_dl_layer_reduce erstellt einen Reduce-Layer dessen Handle in DLLayerReduceDLLayerReduceDLLayerReduceDLLayerReducedllayer_reduce zurückgegeben wird.

Ein Reduce-Layer wendet eine bestimmte Operation auf den Datentensor des eingegebenen Layer-Handles an um ihn entlang einer oder mehrerer Achsen auf einen einzelnen Wert zu reduzieren. Infolgedessen hat der Ausgabetensor die gleiche Form wie der Eingabetensor, aber entlang der in AxesAxesAxesaxesaxes angegebenen Achsen die Dimension eins.

Der Parameter DLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input bestimmt den zuführenden Eingabelayer. Dieser Layer erwartet einen einzelnen Layer als Eingabe.

Der Parameter LayerNameLayerNameLayerNamelayerNamelayer_name legt einen individuellen Layernamen fest. Es ist zu beachten, dass beim Erstellen eines Modells mit create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelcreate_dl_model jeder Layer des erstellten Netzes einen eindeutigen Namen haben muss.

Der Parameter OperationOperationOperationoperationoperation bestimmt die angewandte Operation. Die Operation wird auf die Werte entlang der in AxesAxesAxesaxesaxes angegebenen Achsen des Eingabelayers ausgeführt und das Ergebnis wird im Ausgabetensor an die entsprechende Stelle geschrieben. Die unterstützten Werte für OperationOperationOperationoperationoperation sind:

Die folgenden generischen Parameter GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name und die entsprechenden Werte GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value werden unterstützt:

'is_inference_output'"is_inference_output""is_inference_output""is_inference_output""is_inference_output":

Bestimmt, ob apply_dl_modelapply_dl_modelApplyDlModelApplyDlModelapply_dl_model die Ausgabe dieses Layers im Dictionary DLResultBatchDLResultBatchDLResultBatchDLResultBatchdlresult_batch zurückgibt, auch ohne den Layer in OutputsOutputsOutputsoutputsoutputs anzugeben ('true'"true""true""true""true"), oder nur falls er angegeben wird ('false'"false""false""false""false").

Default: 'false'"false""false""false""false"

'div_eps'"div_eps""div_eps""div_eps""div_eps":

Kleiner skalarer Wert, der zur Stabilisierung des Trainings verwendet wird. Konkret wird der Wert im Falle einer Division zum Nenner addiert, um ein Teilen durch Null zu verhindern.

Default: 1e-10

Bestimmte Parameter von Layern, die mit create_dl_layer_reducecreate_dl_layer_reduceCreateDlLayerReduceCreateDlLayerReducecreate_dl_layer_reduce erzeugt wurden, können mit weiteren Operatoren gesetzt und abgerufen werden. Die folgenden Tabellen geben einen Überblick, welche Parameter mit set_dl_model_layer_paramset_dl_model_layer_paramSetDlModelLayerParamSetDlModelLayerParamset_dl_model_layer_param gesetzt werden können und welche mit get_dl_model_layer_paramget_dl_model_layer_paramGetDlModelLayerParamGetDlModelLayerParamget_dl_model_layer_param oder get_dl_layer_paramget_dl_layer_paramGetDlLayerParamGetDlLayerParamget_dl_layer_param ausgelesen werden können. Es ist zu beachten, dass die Operatoren set_dl_model_layer_paramset_dl_model_layer_paramSetDlModelLayerParamSetDlModelLayerParamset_dl_model_layer_param und get_dl_model_layer_paramget_dl_model_layer_paramGetDlModelLayerParamGetDlModelLayerParamget_dl_model_layer_param ein Modell benötigen, das mit create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelcreate_dl_model erzeugt wurde.

Layer-Parameter set get
'axes'"axes""axes""axes""axes" (AxesAxesAxesaxesaxes) x
'input_layer'"input_layer""input_layer""input_layer""input_layer" (DLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input) x
'name'"name""name""name""name" (LayerNameLayerNameLayerNamelayerNamelayer_name) x x
'operation'"operation""operation""operation""operation" (OperationOperationOperationoperationoperation) x
'output_layer'"output_layer""output_layer""output_layer""output_layer" (DLLayerReduceDLLayerReduceDLLayerReduceDLLayerReducedllayer_reduce) x
'shape'"shape""shape""shape""shape" x
'type'"type""type""type""type" x
Generische Layer-Parameter set get
'is_inference_output'"is_inference_output""is_inference_output""is_inference_output""is_inference_output" x x
'num_trainable_params'"num_trainable_params""num_trainable_params""num_trainable_params""num_trainable_params" x
'div_eps'"div_eps""div_eps""div_eps""div_eps" x

Ausführungsinformationen

Parameter

DLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input (input_control)  dl_layer HDlLayer, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Zuführender Eingabelayer.

LayerNameLayerNameLayerNamelayerNamelayer_name (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Name des Ausgabelayers.

OperationOperationOperationoperationoperation (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Reduce Operation.

Default: 'norm_l2' "norm_l2" "norm_l2" "norm_l2" "norm_l2"

Werteliste: 'norm_l2'"norm_l2""norm_l2""norm_l2""norm_l2", 'sum'"sum""sum""sum""sum"

AxesAxesAxesaxesaxes (input_control)  integer(-array) HTupleMaybeSequence[Union[int, str]]HTupleHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*)

Achsen entlang welcher die Reduce Operation ausgeführt werden soll.

Default: [2,3]

Werteliste: 0, 1, 2, 3, 'batch'"batch""batch""batch""batch", 'depth'"depth""depth""depth""depth", 'height'"height""height""height""height", 'width'"width""width""width""width"

GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control)  attribute.name(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Namen der generischen Eingabeparameter.

Default: []

Werteliste: 'div_eps'"div_eps""div_eps""div_eps""div_eps", 'is_inference_output'"is_inference_output""is_inference_output""is_inference_output""is_inference_output"

GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (input_control)  attribute.value(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Werte der generischen Eingabeparameter.

Default: []

Wertevorschläge: 1e-10, 'true'"true""true""true""true", 'false'"false""false""false""false"

DLLayerReduceDLLayerReduceDLLayerReduceDLLayerReducedllayer_reduce (output_control)  dl_layer HDlLayer, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Reduce-Layer.

Beispiel (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)

Vorgänger

create_dl_layer_inputcreate_dl_layer_inputCreateDlLayerInputCreateDlLayerInputcreate_dl_layer_input

Nachfolger

create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelcreate_dl_model

Modul

Deep Learning Professional