create_dl_layer_matmul T_create_dl_layer_matmul CreateDlLayerMatmul CreateDlLayerMatmul create_dl_layer_matmul (Operator)
Name
create_dl_layer_matmul T_create_dl_layer_matmul CreateDlLayerMatmul CreateDlLayerMatmul create_dl_layer_matmul
— Create a MatMul layer.
Signature
void CreateDlLayerMatmul (const HTuple& DLLayerA , const HTuple& DLLayerB , const HTuple& LayerName , const HTuple& GenParamName , const HTuple& GenParamValue , HTuple* DLLayerMatMul )
HDlLayer HDlLayer ::CreateDlLayerMatmul (const HDlLayer& DLLayerB , const HString& LayerName , const HTuple& GenParamName , const HTuple& GenParamValue ) const
HDlLayer HDlLayer ::CreateDlLayerMatmul (const HDlLayer& DLLayerB , const HString& LayerName , const HString& GenParamName , const HString& GenParamValue ) const
HDlLayer HDlLayer ::CreateDlLayerMatmul (const HDlLayer& DLLayerB , const char* LayerName , const char* GenParamName , const char* GenParamValue ) const
HDlLayer HDlLayer ::CreateDlLayerMatmul (const HDlLayer& DLLayerB , const wchar_t* LayerName , const wchar_t* GenParamName , const wchar_t* GenParamValue ) const
(
Windows only)
static void HOperatorSet .CreateDlLayerMatmul (HTuple DLLayerA , HTuple DLLayerB , HTuple layerName , HTuple genParamName , HTuple genParamValue , out HTuple DLLayerMatMul )
HDlLayer HDlLayer .CreateDlLayerMatmul (HDlLayer DLLayerB , string layerName , HTuple genParamName , HTuple genParamValue )
HDlLayer HDlLayer .CreateDlLayerMatmul (HDlLayer DLLayerB , string layerName , string genParamName , string genParamValue )
Description
The operator create_dl_layer_matmul create_dl_layer_matmul CreateDlLayerMatmul CreateDlLayerMatmul create_dl_layer_matmul
creates a MatMul layer
whose handle is returned in DLLayerMatMul DLLayerMatMul DLLayerMatMul DLLayerMatMul dllayer_mat_mul
.
A MatMul layer multiplies the 2D matrices, given in the latter two
dimensions (H, W) of input DLLayerA DLLayerA DLLayerA DLLayerA dllayer_a
, with the corresponding
2D matrices of input DLLayerB DLLayerB DLLayerB DLLayerB dllayer_b
, also given in the latter two
dimensions (H, W).
The output in DLLayerMatMul DLLayerMatMul DLLayerMatMul DLLayerMatMul dllayer_mat_mul
is hence given by
.
The MatMul layer supports broadcasting for the first input DLLayerA DLLayerA DLLayerA DLLayerA dllayer_a
.
That means, if the batch size or the number of channels in DLLayerA DLLayerA DLLayerA DLLayerA dllayer_a
equals one then the first batch item or channel of DLLayerA DLLayerA DLLayerA DLLayerA dllayer_a
is
multiplied with all batch items or channels of DLLayerB DLLayerB DLLayerB DLLayerB dllayer_b
,
respectively.
To make the multiplication work, the width of DLLayerA DLLayerA DLLayerA DLLayerA dllayer_a
must be equal
to the height of DLLayerB DLLayerB DLLayerB DLLayerB dllayer_b
.
The following generic parameters GenParamName GenParamName GenParamName genParamName gen_param_name
and the corresponding
values GenParamValue GenParamValue GenParamValue genParamValue gen_param_value
are supported:
'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 apply_dl_model
will include the output of this
layer in the dictionary DLResultBatch DLResultBatch DLResultBatch DLResultBatch dlresult_batch
even without specifying this
layer in Outputs Outputs Outputs outputs outputs
('true' "true" "true" "true" "true" ) or not ('false' "false" "false" "false" "false" ).
Default:
'false' "false" "false" "false" "false"
'num_trainable_params' "num_trainable_params" "num_trainable_params" "num_trainable_params" "num_trainable_params" :
Number of trainable parameters (weights and biases) of the layer.
'transpose_a' "transpose_a" "transpose_a" "transpose_a" "transpose_a" :
Matrices of input DLLayerA DLLayerA DLLayerA DLLayerA dllayer_a
are transposed:
.
Default:
'false' "false" "false" "false" "false"
'transpose_b' "transpose_b" "transpose_b" "transpose_b" "transpose_b" :
Matrices of input DLLayerB DLLayerB DLLayerB DLLayerB dllayer_b
are transposed:
.
Default:
'false' "false" "false" "false" "false"
Certain parameters of layers created using this operator
create_dl_layer_matmul create_dl_layer_matmul CreateDlLayerMatmul CreateDlLayerMatmul create_dl_layer_matmul
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 set_dl_model_layer_param
and which ones can be retrieved
using get_dl_model_layer_param get_dl_model_layer_param GetDlModelLayerParam GetDlModelLayerParam get_dl_model_layer_param
or get_dl_layer_param get_dl_layer_param GetDlLayerParam GetDlLayerParam get_dl_layer_param
.
Note, the operators set_dl_model_layer_param set_dl_model_layer_param SetDlModelLayerParam SetDlModelLayerParam set_dl_model_layer_param
and
get_dl_model_layer_param get_dl_model_layer_param GetDlModelLayerParam GetDlModelLayerParam get_dl_model_layer_param
require a model created by
create_dl_model create_dl_model 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"
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
DLLayerA DLLayerA DLLayerA DLLayerA dllayer_a
(input_control) dl_layer →
HDlLayer , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Input layer A.
DLLayerB DLLayerB DLLayerB DLLayerB dllayer_b
(input_control) dl_layer →
HDlLayer , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Input layer B.
LayerName LayerName LayerName layerName layer_name
(input_control) string →
HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Name of the output layer.
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:
[]
List of values:
'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" , 'transpose_a' "transpose_a" "transpose_a" "transpose_a" "transpose_a" , 'transpose_b' "transpose_b" "transpose_b" "transpose_b" "transpose_b"
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:
[]
Suggested values:
'true' "true" "true" "true" "true" , 'false' "false" "false" "false" "false"
DLLayerMatMul DLLayerMatMul DLLayerMatMul DLLayerMatMul dllayer_mat_mul
(output_control) dl_layer →
HDlLayer , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
MatMul layer.
Module
Deep Learning Professional