create_dl_layer_elementwise T_create_dl_layer_elementwise CreateDlLayerElementwise CreateDlLayerElementwise create_dl_layer_elementwise (Operator)
Name
create_dl_layer_elementwise T_create_dl_layer_elementwise CreateDlLayerElementwise CreateDlLayerElementwise create_dl_layer_elementwise
— Create an elementwise layer.
Signature
void CreateDlLayerElementwise (const HTuple& DLLayerInputs , const HTuple& LayerName , const HTuple& Operation , const HTuple& Coefficients , const HTuple& GenParamName , const HTuple& GenParamValue , HTuple* DLLayerElementWise )
static HDlLayer HDlLayer ::CreateDlLayerElementwise (const HDlLayerArray& DLLayerInputs , const HString& LayerName , const HString& Operation , const HTuple& Coefficients , const HTuple& GenParamName , const HTuple& GenParamValue )
HDlLayer HDlLayer ::CreateDlLayerElementwise (const HString& LayerName , const HString& Operation , double Coefficients , const HString& GenParamName , const HString& GenParamValue ) const
HDlLayer HDlLayer ::CreateDlLayerElementwise (const char* LayerName , const char* Operation , double Coefficients , const char* GenParamName , const char* GenParamValue ) const
HDlLayer HDlLayer ::CreateDlLayerElementwise (const wchar_t* LayerName , const wchar_t* Operation , double Coefficients , const wchar_t* GenParamName , const wchar_t* GenParamValue ) const
(Windows only)
static void HOperatorSet .CreateDlLayerElementwise (HTuple DLLayerInputs , HTuple layerName , HTuple operation , HTuple coefficients , HTuple genParamName , HTuple genParamValue , out HTuple DLLayerElementWise )
static HDlLayer HDlLayer .CreateDlLayerElementwise (HDlLayer[] DLLayerInputs , string layerName , string operation , HTuple coefficients , HTuple genParamName , HTuple genParamValue )
HDlLayer HDlLayer .CreateDlLayerElementwise (string layerName , string operation , double coefficients , string genParamName , string genParamValue )
Description
The operator create_dl_layer_elementwise create_dl_layer_elementwise CreateDlLayerElementwise CreateDlLayerElementwise CreateDlLayerElementwise create_dl_layer_elementwise
creates an element-wise
layer whose handle is returned in DLLayerElementWise DLLayerElementWise DLLayerElementWise DLLayerElementWise DLLayerElementWise dllayer_element_wise
.
An elementwise layer applies a certain operation to every data tensor of
the input layers handles and to each element of the data tensor.
As a consequence, all input data tensors should be of the same shape and
the output tensor has the same shape as the first input tensor.
The parameter DLLayerInputs DLLayerInputs DLLayerInputs DLLayerInputs DLLayerInputs dllayer_inputs
determines the feeding input layers.
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 Operation Operation Operation Operation operation operation
specifies the operation that is applied.
Depending on Operation Operation Operation Operation operation operation
, the layer supports implicit broadcasting.
I.e., if one of the shape dimensions
(batch_size
, depth
, height
, width
)
of the second or any of the following input tensors is 1, the values are
implicitly multiplied along that dimension to match the shape of the first
input.
The supported values are:
'maximum' "maximum" "maximum" "maximum" "maximum" "maximum" : Element-wise maximum. Broadcasting is fully
supported.
'minimum' "minimum" "minimum" "minimum" "minimum" "minimum" : Element-wise minimum. Broadcasting is fully
supported.
'product' "product" "product" "product" "product" "product" : Element-wise product. Broadcasting is
supported, but all inputs following the second
input must have the same shape as the second input.
'sum' "sum" "sum" "sum" "sum" "sum" : Element-wise summation. Broadcasting is not
supported.
The optional parameter Coefficients Coefficients Coefficients Coefficients coefficients coefficients
determines a weighting
coefficient for every input tensor.
The number of values in Coefficients Coefficients Coefficients Coefficients coefficients coefficients
must match the number of feeding
layers in DLLayerInputs DLLayerInputs DLLayerInputs DLLayerInputs DLLayerInputs dllayer_inputs
.
Set Coefficients Coefficients Coefficients Coefficients coefficients coefficients
equal to [] if
no coefficients shall be used in the element-wise operation.
Restriction: No coefficients can be set for
Operation Operation Operation Operation operation operation
= 'product' "product" "product" "product" "product" "product" .
Example: for Operation Operation Operation Operation operation operation
= 'sum' "sum" "sum" "sum" "sum" "sum" ,
the
-th element of the output data tensor is given by
where
is the number of input data tensors.
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"
Certain parameters of layers created using this operator
create_dl_layer_elementwise create_dl_layer_elementwise CreateDlLayerElementwise CreateDlLayerElementwise CreateDlLayerElementwise create_dl_layer_elementwise
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"
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
DLLayerInputs DLLayerInputs DLLayerInputs DLLayerInputs DLLayerInputs dllayer_inputs
(input_control) dl_layer(-array) →
HDlLayer , HTuple MaybeSequence[HHandle] HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Feeding input layers.
LayerName LayerName LayerName LayerName layerName layer_name
(input_control) string →
HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Name of the output layer.
Operation Operation Operation Operation operation operation
(input_control) string →
HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Element-wise operations.
Default value:
'sum'
"sum"
"sum"
"sum"
"sum"
"sum"
List of values: 'maximum' "maximum" "maximum" "maximum" "maximum" "maximum" , 'minimum' "minimum" "minimum" "minimum" "minimum" "minimum" , 'product' "product" "product" "product" "product" "product" , 'sum' "sum" "sum" "sum" "sum" "sum"
Coefficients Coefficients Coefficients Coefficients coefficients coefficients
(input_control) number(-array) →
HTuple MaybeSequence[float] HTuple Htuple (real) (double ) (double ) (double )
Optional input tensor coefficients.
Default value: []
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"
GenParamValue GenParamValue GenParamValue GenParamValue genParamValue gen_param_value
(input_control) attribute.value(-array) →
HTuple MaybeSequence[Union[int, float, str]] HTuple Htuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
Generic input parameter values.
Default value: []
Suggested values: 'true' "true" "true" "true" "true" "true" , 'false' "false" "false" "false" "false" "false"
DLLayerElementWise DLLayerElementWise DLLayerElementWise DLLayerElementWise DLLayerElementWise dllayer_element_wise
(output_control) dl_layer →
HDlLayer , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Elementwise layer.
Module
Deep Learning Training