create_dl_layer_softmaxT_create_dl_layer_softmaxCreateDlLayerSoftmaxCreateDlLayerSoftmaxcreate_dl_layer_softmax (Operator)

Name

create_dl_layer_softmaxT_create_dl_layer_softmaxCreateDlLayerSoftmaxCreateDlLayerSoftmaxcreate_dl_layer_softmax — Create a softmax layer.

Signature

create_dl_layer_softmax( : : DLLayerInput, LayerName, GenParamName, GenParamValue : DLLayerSoftMax)

Herror T_create_dl_layer_softmax(const Htuple DLLayerInput, const Htuple LayerName, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DLLayerSoftMax)

void CreateDlLayerSoftmax(const HTuple& DLLayerInput, const HTuple& LayerName, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerSoftMax)

HDlLayer HDlLayer::CreateDlLayerSoftmax(const HString& LayerName, const HTuple& GenParamName, const HTuple& GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerSoftmax(const HString& LayerName, const HString& GenParamName, const HString& GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerSoftmax(const char* LayerName, const char* GenParamName, const char* GenParamValue) const

HDlLayer HDlLayer::CreateDlLayerSoftmax(const wchar_t* LayerName, const wchar_t* GenParamName, const wchar_t* GenParamValue) const   (Windows only)

static void HOperatorSet.CreateDlLayerSoftmax(HTuple DLLayerInput, HTuple layerName, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerSoftMax)

HDlLayer HDlLayer.CreateDlLayerSoftmax(string layerName, HTuple genParamName, HTuple genParamValue)

HDlLayer HDlLayer.CreateDlLayerSoftmax(string layerName, string genParamName, string genParamValue)

def create_dl_layer_softmax(dllayer_input: HHandle, layer_name: str, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]]) -> HHandle

Description

The operator create_dl_layer_softmaxcreate_dl_layer_softmaxCreateDlLayerSoftmaxCreateDlLayerSoftmaxCreateDlLayerSoftmaxcreate_dl_layer_softmax creates a softmax layer whose handle is returned in DLLayerSoftMaxDLLayerSoftMaxDLLayerSoftMaxDLLayerSoftMaxDLLayerSoftMaxdllayer_soft_max.

The parameter DLLayerInputDLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input determines the feeding input layer and expects the layer handle as value.

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

The softmax layer applies the softmax function which is defined for each input as follows: where is the number of inputs. During training, the result of the softmax function is additionally shifted and transformed by a logarithm function, such that the values are suitable as input to e.g., a cross entropy loss layer. This behavior can be changed by setting the generic parameter 'output_mode'"output_mode""output_mode""output_mode""output_mode""output_mode", see below.

The following generic parameters GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and the corresponding values GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value are supported:

'output_mode'"output_mode""output_mode""output_mode""output_mode""output_mode":

This parameter determines if and in which case the output is transformed by a logarithm function:

Default: 'default'"default""default""default""default""default".

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

Determines whether apply_dl_modelapply_dl_modelApplyDlModelApplyDlModelApplyDlModelapply_dl_model will include the output of this layer in the dictionary DLResultBatchDLResultBatchDLResultBatchDLResultBatchDLResultBatchdlresult_batch even without specifying this layer in OutputsOutputsOutputsOutputsoutputsoutputs ('true'"true""true""true""true""true") or not ('false'"false""false""false""false""false").

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

'num_trainable_params'"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.

Certain parameters of layers created using this operator create_dl_layer_softmaxcreate_dl_layer_softmaxCreateDlLayerSoftmaxCreateDlLayerSoftmaxCreateDlLayerSoftmaxcreate_dl_layer_softmax 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_paramSetDlModelLayerParamSetDlModelLayerParamSetDlModelLayerParamset_dl_model_layer_param and which ones can be retrieved using get_dl_model_layer_paramget_dl_model_layer_paramGetDlModelLayerParamGetDlModelLayerParamGetDlModelLayerParamget_dl_model_layer_param or get_dl_layer_paramget_dl_layer_paramGetDlLayerParamGetDlLayerParamGetDlLayerParamget_dl_layer_param. Note, the operators set_dl_model_layer_paramset_dl_model_layer_paramSetDlModelLayerParamSetDlModelLayerParamSetDlModelLayerParamset_dl_model_layer_param and get_dl_model_layer_paramget_dl_model_layer_paramGetDlModelLayerParamGetDlModelLayerParamGetDlModelLayerParamget_dl_model_layer_param require a model created by create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelCreateDlModelcreate_dl_model.

Layer Parameters set get
'input_layer'"input_layer""input_layer""input_layer""input_layer""input_layer"(DLLayerInputDLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input)
'name'"name""name""name""name""name" (LayerNameLayerNameLayerNameLayerNamelayerNamelayer_name)
'output_layer'"output_layer""output_layer""output_layer""output_layer""output_layer" (DLLayerSoftMaxDLLayerSoftMaxDLLayerSoftMaxDLLayerSoftMaxDLLayerSoftMaxdllayer_soft_max)
'shape'"shape""shape""shape""shape""shape"
'type'"type""type""type""type""type"
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"
'output_mode'"output_mode""output_mode""output_mode""output_mode""output_mode"

Execution Information

Parameters

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

Feeding layer.

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

Name of the layer.

GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control)  attribute.name(-array) HTupleMaybeSequence[str]HTupleHtuple (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", 'output_mode'"output_mode""output_mode""output_mode""output_mode""output_mode"

GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_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 value: []

Suggested values: 'default'"default""default""default""default""default", 'no_log_training'"no_log_training""no_log_training""no_log_training""no_log_training""no_log_training", 'log_inference'"log_inference""log_inference""log_inference""log_inference""log_inference", 'true'"true""true""true""true""true", 'false'"false""false""false""false""false"

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

Softmax layer.

Module

Deep Learning Training