Operator Reference

create_dl_layer_loss_huberT_create_dl_layer_loss_huberCreateDlLayerLossHuberCreateDlLayerLossHubercreate_dl_layer_loss_huber (Operator)

create_dl_layer_loss_huberT_create_dl_layer_loss_huberCreateDlLayerLossHuberCreateDlLayerLossHubercreate_dl_layer_loss_huber — Create a Huber loss layer.

Signature

Herror T_create_dl_layer_loss_huber(const Htuple DLLayerInput, const Htuple DLLayerTarget, const Htuple DLLayerWeights, const Htuple DLLayerNormalization, const Htuple LayerName, const Htuple LossWeight, const Htuple Beta, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DLLayerLossHuber)

void CreateDlLayerLossHuber(const HTuple& DLLayerInput, const HTuple& DLLayerTarget, const HTuple& DLLayerWeights, const HTuple& DLLayerNormalization, const HTuple& LayerName, const HTuple& LossWeight, const HTuple& Beta, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerLossHuber)

HDlLayer HDlLayer::CreateDlLayerLossHuber(const HDlLayer& DLLayerTarget, const HDlLayer& DLLayerWeights, const HDlLayer& DLLayerNormalization, const HString& LayerName, double LossWeight, double Beta, const HTuple& GenParamName, const HTuple& GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerLossHuber(const HDlLayer& DLLayerTarget, const HDlLayer& DLLayerWeights, const HDlLayer& DLLayerNormalization, const HString& LayerName, double LossWeight, double Beta, const HString& GenParamName, const HString& GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerLossHuber(const HDlLayer& DLLayerTarget, const HDlLayer& DLLayerWeights, const HDlLayer& DLLayerNormalization, const char* LayerName, double LossWeight, double Beta, const char* GenParamName, const char* GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerLossHuber(const HDlLayer& DLLayerTarget, const HDlLayer& DLLayerWeights, const HDlLayer& DLLayerNormalization, const wchar_t* LayerName, double LossWeight, double Beta, const wchar_t* GenParamName, const wchar_t* GenParamValue) const   ( Windows only)

def create_dl_layer_loss_huber(dllayer_input: HHandle, dllayer_target: HHandle, dllayer_weights: HHandle, dllayer_normalization: HHandle, layer_name: str, loss_weight: float, beta: float, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]]) -> HHandle

Description

The operator create_dl_layer_loss_hubercreate_dl_layer_loss_huberCreateDlLayerLossHuberCreateDlLayerLossHubercreate_dl_layer_loss_huber creates a Huber loss layer whose handle is returned in DLLayerLossHuberDLLayerLossHuberDLLayerLossHuberDLLayerLossHuberdllayer_loss_huber. The Huber loss is defined by

This layer expects multiple layers as input:

The underlying data tensors are assumed to be of the same shape with a total number of elements.

The parameter DLLayerNormalizationDLLayerNormalizationDLLayerNormalizationDLLayerNormalizationdllayer_normalization can be used to determine the normalization factor . If DLLayerNormalizationDLLayerNormalizationDLLayerNormalizationDLLayerNormalizationdllayer_normalization is set to an empty tuple, the sum over all weights is used for the normalization .

The parameter LossWeightLossWeightLossWeightlossWeightloss_weight determines the scalar weight factor .

The parameter BetaBetaBetabetabeta sets the value for in the formula. If BetaBetaBetabetabeta is set to 0, the Huber loss is equal to an L1-loss.

The parameter LayerNameLayerNameLayerNamelayerNamelayer_name sets an individual layer name. Note that if creating a model using create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelcreate_dl_model each layer of the created network must have a unique name.

The following generic parameters GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and the corresponding values GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value are supported:

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

Determines whether apply_dl_modelapply_dl_modelApplyDlModelApplyDlModelapply_dl_model will include the output of this layer in the dictionary DLResultBatchDLResultBatchDLResultBatchDLResultBatchdlresult_batch even without specifying this layer in OutputsOutputsOutputsoutputsoutputs ('true'"true""true""true""true") or not ('false'"false""false""false""false").

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

Certain parameters of layers created using this operator create_dl_layer_loss_hubercreate_dl_layer_loss_huberCreateDlLayerLossHuberCreateDlLayerLossHubercreate_dl_layer_loss_huber can be set and retrieved using further operators. The following tables give an overview, which parameters can be set using set_dl_model_layer_paramset_dl_model_layer_paramSetDlModelLayerParamSetDlModelLayerParamset_dl_model_layer_param and which ones can be retrieved using get_dl_model_layer_paramget_dl_model_layer_paramGetDlModelLayerParamGetDlModelLayerParamget_dl_model_layer_param or get_dl_layer_paramget_dl_layer_paramGetDlLayerParamGetDlLayerParamget_dl_layer_param. Note, the operators set_dl_model_layer_paramset_dl_model_layer_paramSetDlModelLayerParamSetDlModelLayerParamset_dl_model_layer_param and get_dl_model_layer_paramget_dl_model_layer_paramGetDlModelLayerParamGetDlModelLayerParamget_dl_model_layer_param require a model created by create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelcreate_dl_model.

Layer Parameters set get
'beta'"beta""beta""beta""beta" (BetaBetaBetabetabeta) x x
'input_layer'"input_layer""input_layer""input_layer""input_layer" (DLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input, DLLayerTargetDLLayerTargetDLLayerTargetDLLayerTargetdllayer_target, DLLayerWeightsDLLayerWeightsDLLayerWeightsDLLayerWeightsdllayer_weights, and/or DLLayerNormalizationDLLayerNormalizationDLLayerNormalizationDLLayerNormalizationdllayer_normalization) x
'loss_weight'"loss_weight""loss_weight""loss_weight""loss_weight" (LossWeightLossWeightLossWeightlossWeightloss_weight) x x
'name'"name""name""name""name" (LayerNameLayerNameLayerNamelayerNamelayer_name) x x
'output_layer'"output_layer""output_layer""output_layer""output_layer" (DLLayerLossHuberDLLayerLossHuberDLLayerLossHuberDLLayerLossHuberdllayer_loss_huber) x
'shape'"shape""shape""shape""shape" x
'type'"type""type""type""type" x
Generic Layer Parameters 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

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

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

Input layer.

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

Target layer.

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

Weights layer.

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

Normalization layer.

Default: []

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

Name of the output layer.

LossWeightLossWeightLossWeightlossWeightloss_weight (input_control)  number HTuplefloatHTupleHtuple (real) (double) (double) (double)

Scalar weight factor.

Default: 1.0

BetaBetaBetabetabeta (input_control)  number HTuplefloatHTupleHtuple (real) (double) (double) (double)

Beta value in the loss-defining formula.

Default: 1.1

Restriction: Beta >= 0

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

Generic input parameter names.

Default: []

List of values: '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)

Generic input parameter values.

Default: []

Suggested values: 'true'"true""true""true""true", 'false'"false""false""false""false"

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

Huber loss layer.

Module

Deep Learning Professional