create_dl_layer_matmulT_create_dl_layer_matmulCreateDlLayerMatmulCreateDlLayerMatmulcreate_dl_layer_matmul (Operator)

Name

create_dl_layer_matmulT_create_dl_layer_matmulCreateDlLayerMatmulCreateDlLayerMatmulcreate_dl_layer_matmul — Create a MatMul layer.

Signature

create_dl_layer_matmul( : : DLLayerA, DLLayerB, LayerName, GenParamName, GenParamValue : DLLayerMatMul)

Herror T_create_dl_layer_matmul(const Htuple DLLayerA, const Htuple DLLayerB, const Htuple LayerName, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DLLayerMatMul)

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)

def create_dl_layer_matmul(dllayer_a: HHandle, dllayer_b: HHandle, layer_name: str, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]]) -> HHandle

Description

The operator create_dl_layer_matmulcreate_dl_layer_matmulCreateDlLayerMatmulCreateDlLayerMatmulcreate_dl_layer_matmul creates a MatMul layer whose handle is returned in DLLayerMatMulDLLayerMatMulDLLayerMatMulDLLayerMatMuldllayer_mat_mul.

A MatMul layer multiplies the 2D matrices, given in the latter two dimensions (H, W) of input DLLayerADLLayerADLLayerADLLayerAdllayer_a, with the corresponding 2D matrices of input DLLayerBDLLayerBDLLayerBDLLayerBdllayer_b, also given in the latter two dimensions (H, W). The output in DLLayerMatMulDLLayerMatMulDLLayerMatMulDLLayerMatMuldllayer_mat_mul is hence given by .

The MatMul layer supports broadcasting for the first input DLLayerADLLayerADLLayerADLLayerAdllayer_a. That means, if the batch size or the number of channels in DLLayerADLLayerADLLayerADLLayerAdllayer_a equals one then the first batch item or channel of DLLayerADLLayerADLLayerADLLayerAdllayer_a is multiplied with all batch items or channels of DLLayerBDLLayerBDLLayerBDLLayerBdllayer_b, respectively.

To make the multiplication work, the width of DLLayerADLLayerADLLayerADLLayerAdllayer_a must be equal to the height of DLLayerBDLLayerBDLLayerBDLLayerBdllayer_b.

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"

'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 DLLayerADLLayerADLLayerADLLayerAdllayer_a are transposed: .

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

'transpose_b'"transpose_b""transpose_b""transpose_b""transpose_b":

Matrices of input DLLayerBDLLayerBDLLayerBDLLayerBdllayer_b are transposed: .

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

Certain parameters of layers created using this operator create_dl_layer_matmulcreate_dl_layer_matmulCreateDlLayerMatmulCreateDlLayerMatmulcreate_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_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
'input_layer'"input_layer""input_layer""input_layer""input_layer" x
'name'"name""name""name""name" (LayerNameLayerNameLayerNamelayerNamelayer_name) x x
'output_layer'"output_layer""output_layer""output_layer""output_layer" (DLLayerMatMulDLLayerMatMulDLLayerMatMulDLLayerMatMuldllayer_mat_mul) x
'shape'"shape""shape""shape""shape" x
'transpose_a'"transpose_a""transpose_a""transpose_a""transpose_a" x
'transpose_b'"transpose_b""transpose_b""transpose_b""transpose_b" 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

Parameters

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

Input layer A.

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

Input layer B.

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

Name of the output layer.

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", '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"

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"

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

MatMul layer.

Module

Deep Learning Training