create_dl_layer_loss_distance T_create_dl_layer_loss_distance CreateDlLayerLossDistance CreateDlLayerLossDistance create_dl_layer_loss_distance (Operator)
Name
create_dl_layer_loss_distance T_create_dl_layer_loss_distance CreateDlLayerLossDistance CreateDlLayerLossDistance create_dl_layer_loss_distance
— Create a distance loss layer.
Signature
void CreateDlLayerLossDistance (const HTuple& DLLayerInput , const HTuple& DLLayerTarget , const HTuple& DLLayerWeights , const HTuple& LayerName , const HTuple& DistanceType , const HTuple& LossWeight , const HTuple& GenParamName , const HTuple& GenParamValue , HTuple* DLLayerLossDistance )
HDlLayer HDlLayer ::CreateDlLayerLossDistance (const HDlLayer& DLLayerTarget , const HDlLayer& DLLayerWeights , const HString& LayerName , const HString& DistanceType , double LossWeight , const HTuple& GenParamName , const HTuple& GenParamValue ) const
HDlLayer HDlLayer ::CreateDlLayerLossDistance (const HDlLayer& DLLayerTarget , const HDlLayer& DLLayerWeights , const HString& LayerName , const HString& DistanceType , double LossWeight , const HString& GenParamName , const HString& GenParamValue ) const
HDlLayer HDlLayer ::CreateDlLayerLossDistance (const HDlLayer& DLLayerTarget , const HDlLayer& DLLayerWeights , const char* LayerName , const char* DistanceType , double LossWeight , const char* GenParamName , const char* GenParamValue ) const
HDlLayer HDlLayer ::CreateDlLayerLossDistance (const HDlLayer& DLLayerTarget , const HDlLayer& DLLayerWeights , const wchar_t* LayerName , const wchar_t* DistanceType , double LossWeight , const wchar_t* GenParamName , const wchar_t* GenParamValue ) const
(Windows only)
static void HOperatorSet .CreateDlLayerLossDistance (HTuple DLLayerInput , HTuple DLLayerTarget , HTuple DLLayerWeights , HTuple layerName , HTuple distanceType , HTuple lossWeight , HTuple genParamName , HTuple genParamValue , out HTuple DLLayerLossDistance )
HDlLayer HDlLayer .CreateDlLayerLossDistance (HDlLayer DLLayerTarget , HDlLayer DLLayerWeights , string layerName , string distanceType , double lossWeight , HTuple genParamName , HTuple genParamValue )
HDlLayer HDlLayer .CreateDlLayerLossDistance (HDlLayer DLLayerTarget , HDlLayer DLLayerWeights , string layerName , string distanceType , double lossWeight , string genParamName , string genParamValue )
Description
The operator create_dl_layer_loss_distance create_dl_layer_loss_distance CreateDlLayerLossDistance CreateDlLayerLossDistance CreateDlLayerLossDistance create_dl_layer_loss_distance
creates a distance loss
layer whose handle is returned in DLLayerLossDistance DLLayerLossDistance DLLayerLossDistance DLLayerLossDistance DLLayerLossDistance dllayer_loss_distance
.
This layer expects multiple layers as input:
The parameter LayerName LayerName LayerName LayerName layerName layer_name
sets an individual layer name.
Note that if creating a model using create_dl_model create_dl_model CreateDlModel CreateDlModel CreateDlModel create_dl_model
each layer of
the created network must have a unique name.
The parameter LossWeight LossWeight LossWeight LossWeight lossWeight loss_weight
is an overall loss weight if there are
multiple losses in the network.
The parameter DistanceType DistanceType DistanceType DistanceType distanceType distance_type
determines which distance measure is
applied. Currently only 'l2' "l2" "l2" "l2" "l2" "l2" is implemented.
Depending on the generic parameter 'reduce' "reduce" "reduce" "reduce" "reduce" "reduce" this results in
Thus DLLayerInput DLLayerInput DLLayerInput DLLayerInput DLLayerInput dllayer_input
, DLLayerTarget DLLayerTarget DLLayerTarget DLLayerTarget DLLayerTarget dllayer_target
and
DLLayerWeights DLLayerWeights DLLayerWeights DLLayerWeights DLLayerWeights dllayer_weights
should have the same size. Setting the weights in
DLLayerWeights DLLayerWeights DLLayerWeights DLLayerWeights DLLayerWeights dllayer_weights
to 1 will result in a loss normalized over
the number of elements.
The following generic parameters GenParamName GenParamName GenParamName GenParamName genParamName gen_param_name
and the corresponding
values GenParamValue GenParamValue GenParamValue GenParamValue genParamValue gen_param_value
are supported:
'is_inference_output' "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output" :
Determines whether apply_dl_model apply_dl_model ApplyDlModel ApplyDlModel ApplyDlModel apply_dl_model
will include the output of this
layer in the dictionary DLResultBatch DLResultBatch DLResultBatch DLResultBatch DLResultBatch dlresult_batch
even without specifying this
layer in Outputs Outputs Outputs Outputs outputs outputs
('true' "true" "true" "true" "true" "true" ) or not ('false' "false" "false" "false" "false" "false" ).
Default: 'false' "false" "false" "false" "false" "false"
'reduce' "reduce" "reduce" "reduce" "reduce" "reduce" :
Determines whether the output of the layer is reduced:
'true' "true" "true" "true" "true" "true" : The output is reduced to a scalar.
'false' "false" "false" "false" "false" "false" : The output of the layer is a tensor, where each
element is a 'per-pixel' loss (squared differences).
Default: 'true' "true" "true" "true" "true" "true" .
Certain parameters of layers created using this operator
create_dl_layer_loss_distance create_dl_layer_loss_distance CreateDlLayerLossDistance CreateDlLayerLossDistance CreateDlLayerLossDistance create_dl_layer_loss_distance
can be set and retrieved using
further operators.
The following tables give an overview, which parameters can be set
using set_dl_model_layer_param set_dl_model_layer_param SetDlModelLayerParam SetDlModelLayerParam SetDlModelLayerParam set_dl_model_layer_param
and which ones can be retrieved
using get_dl_model_layer_param get_dl_model_layer_param GetDlModelLayerParam GetDlModelLayerParam GetDlModelLayerParam get_dl_model_layer_param
or get_dl_layer_param get_dl_layer_param GetDlLayerParam GetDlLayerParam GetDlLayerParam get_dl_layer_param
.
Note, the operators set_dl_model_layer_param set_dl_model_layer_param SetDlModelLayerParam SetDlModelLayerParam SetDlModelLayerParam set_dl_model_layer_param
and
get_dl_model_layer_param get_dl_model_layer_param GetDlModelLayerParam GetDlModelLayerParam GetDlModelLayerParam get_dl_model_layer_param
require a model created by
create_dl_model create_dl_model CreateDlModel CreateDlModel CreateDlModel create_dl_model
.
Generic Layer Parameters
set
get
'is_inference_output' "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output"
'num_trainable_params' "num_trainable_params" "num_trainable_params" "num_trainable_params" "num_trainable_params" "num_trainable_params"
'reduce' "reduce" "reduce" "reduce" "reduce" "reduce"
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
DLLayerInput DLLayerInput DLLayerInput DLLayerInput DLLayerInput dllayer_input
(input_control) dl_layer →
HDlLayer , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Input layer.
DLLayerTarget DLLayerTarget DLLayerTarget DLLayerTarget DLLayerTarget dllayer_target
(input_control) dl_layer →
HDlLayer , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Target layer.
DLLayerWeights DLLayerWeights DLLayerWeights DLLayerWeights DLLayerWeights dllayer_weights
(input_control) dl_layer →
HDlLayer , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Weights layer.
LayerName LayerName LayerName LayerName layerName layer_name
(input_control) string →
HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Name of the output layer.
DistanceType DistanceType DistanceType DistanceType distanceType distance_type
(input_control) string →
HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Type of distance.
Default value:
'l2'
"l2"
"l2"
"l2"
"l2"
"l2"
List of values: 'l2' "l2" "l2" "l2" "l2" "l2"
LossWeight LossWeight LossWeight LossWeight lossWeight loss_weight
(input_control) number →
HTuple float HTuple Htuple (real) (double ) (double ) (double )
Loss weigtht. Applies to all losses, if several losses
occur in the network.
Default value: 1.0
GenParamName GenParamName GenParamName GenParamName genParamName gen_param_name
(input_control) attribute.name(-array) →
HTuple MaybeSequence[str] HTuple Htuple (string) (string ) (HString ) (char* )
Generic input parameter names.
Default value: []
List of values: 'is_inference_output' "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output" , 'reduce' "reduce" "reduce" "reduce" "reduce" "reduce"
GenParamValue GenParamValue GenParamValue GenParamValue genParamValue gen_param_value
(input_control) attribute.value(-array) →
HTuple MaybeSequence[str] HTuple Htuple (string) (string ) (HString ) (char* )
Generic input parameter values.
Default value: []
Suggested values: 'true' "true" "true" "true" "true" "true" , 'false' "false" "false" "false" "false" "false"
DLLayerLossDistance DLLayerLossDistance DLLayerLossDistance DLLayerLossDistance DLLayerLossDistance dllayer_loss_distance
(output_control) dl_layer →
HDlLayer , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Distance loss layer.
Module
Deep Learning Training