Skip to content

create_dl_layer_denseCreateDlLayerDenseCreateDlLayerDensecreate_dl_layer_denseT_create_dl_layer_dense🔗

Short description🔗

create_dl_layer_denseCreateDlLayerDenseCreateDlLayerDensecreate_dl_layer_denseT_create_dl_layer_dense — Create a dense layer.

Signature🔗

create_dl_layer_dense( dl_layer DLLayerInput, string LayerName, number NumOut, attribute.name GenParamName, attribute.value GenParamValue, out dl_layer DLLayerDense )void CreateDlLayerDense( const HTuple& DLLayerInput, const HTuple& LayerName, const HTuple& NumOut, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerDense )static void HOperatorSet.CreateDlLayerDense( HTuple DLLayerInput, HTuple layerName, HTuple numOut, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerDense )def create_dl_layer_dense( dllayer_input: HHandle, layer_name: str, num_out: int, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]] ) -> HHandle

Herror T_create_dl_layer_dense( const Htuple DLLayerInput, const Htuple LayerName, const Htuple NumOut, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DLLayerDense )

HDlLayer HDlLayer::CreateDlLayerDense( const HString& LayerName, Hlong NumOut, const HTuple& GenParamName, const HTuple& GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerDense( const HString& LayerName, Hlong NumOut, const HString& GenParamName, const HString& GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerDense( const char* LayerName, Hlong NumOut, const char* GenParamName, const char* GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerDense( const wchar_t* LayerName, Hlong NumOut, const wchar_t* GenParamName, const wchar_t* GenParamValue ) const (Windows only)

HDlLayer HDlLayer.CreateDlLayerDense( string layerName, int numOut, HTuple genParamName, HTuple genParamValue )

HDlLayer HDlLayer.CreateDlLayerDense( string layerName, int numOut, string genParamName, string genParamValue )

Description🔗

The operator create_dl_layer_denseCreateDlLayerDense creates a dense or fully connected layer (sometimes also called gemm) with NumOutnumOutnum_out output neurons whose handle is returned in DLLayerDenseDLLayerDensedllayer_dense.

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

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

The following generic parameters GenParamNamegenParamNamegen_param_name and the corresponding values GenParamValuegenParamValuegen_param_value are supported:

  • 'bias_filler'"bias_filler": See create_dl_layer_convolutionCreateDlLayerConvolution for a detailed explanation of this parameter and its values.

    List of values: 'xavier'"xavier", 'msra'"msra", 'const'"const".

    Default: 'const'"const"

  • 'bias_filler_const_val'"bias_filler_const_val": Constant value if 'bias_filler'"bias_filler" = 'const'"const".

    Default: 00

  • 'bias_filler_variance_norm'"bias_filler_variance_norm": See create_dl_layer_convolutionCreateDlLayerConvolution for a detailed explanation of this parameter and its values.

    List of values: 'norm_out'"norm_out", 'norm_in'"norm_in", 'norm_average'"norm_average", or constant value (in combination with 'bias_filler'"bias_filler" = 'msra'"msra").

    Default: 'norm_in'"norm_in"

  • 'bias_term'"bias_term": Determines whether the created dense layer has a bias term ('true'"true") or not ('false'"false").

    Default: 'true'"true"

  • 'is_inference_output'"is_inference_output": Determines whether apply_dl_modelApplyDlModel will include the output of this layer in the dictionary DLResultBatchDLResultBatchdlresult_batch even without specifying this layer in Outputsoutputsoutputs ('true'"true") or not ('false'"false").

    Default: 'false'"false"

  • 'learning_rate_multiplier'"learning_rate_multiplier": Multiplier for the learning rate for this layer that is used during training. If 'learning_rate_multiplier'"learning_rate_multiplier" is set to 0.00.0, the layer is skipped during training.

    Default: 1.01.0

  • 'learning_rate_multiplier_bias'"learning_rate_multiplier_bias": Multiplier for the learning rate of the bias term. The total bias learning rate is the product of 'learning_rate_multiplier_bias'"learning_rate_multiplier_bias" and 'learning_rate_multiplier'"learning_rate_multiplier".

    Default: 1.01.0

  • 'weight_filler'"weight_filler": See create_dl_layer_convolutionCreateDlLayerConvolution for a detailed explanation of this parameter and its values.

    List of values: 'xavier'"xavier", 'msra'"msra", 'const'"const".

    Default: 'xavier'"xavier"

  • 'weight_filler_const_val'"weight_filler_const_val": See create_dl_layer_convolutionCreateDlLayerConvolution for a detailed explanation of this parameter and its values.

    Default: 0.50.5

  • 'weight_filler_variance_norm'"weight_filler_variance_norm": See create_dl_layer_convolutionCreateDlLayerConvolution for a detailed explanation of this parameter and its values.

    List of values: 'norm_in'"norm_in", 'norm_out'"norm_out", 'norm_average'"norm_average", or constant value (in combination with 'bias_filler'"bias_filler" = 'msra'"msra").

    Default: 'norm_in'"norm_in"

Certain parameters of layers created using create_dl_layer_denseCreateDlLayerDense can be set and retrieved using further operators. The following tables give an overview, which parameters can be set using set_dl_model_layer_paramSetDlModelLayerParam and which ones can be retrieved using get_dl_model_layer_paramGetDlModelLayerParam or get_dl_layer_paramGetDlLayerParam. Note, the operators set_dl_model_layer_paramSetDlModelLayerParam and get_dl_model_layer_paramGetDlModelLayerParam require a model created by create_dl_modelCreateDlModel.

Layer Parameters set get
'input_layer'"input_layer" (DLLayerInputDLLayerInputdllayer_input) x
'name'"name" (LayerNamelayerNamelayer_name) x x
'neurons_in'"neurons_in" x
'neurons_out'"neurons_out" (NumOutnumOutnum_out) x
'output_layer'"output_layer" (DLLayerDenseDLLayerDensedllayer_dense) x
'shape'"shape" x
'type'"type" x
Generic Layer Parameters set get
'bias_filler'"bias_filler" x x
'bias_filler_const_val'"bias_filler_const_val" x x
'bias_filler_variance_norm'"bias_filler_variance_norm" x x
'bias_term'"bias_term" x
'is_inference_output'"is_inference_output" x x
'learning_rate_multiplier'"learning_rate_multiplier" x x
'learning_rate_multiplier_bias'"learning_rate_multiplier_bias" x x
'num_trainable_params'"num_trainable_params" x
'weight_filler'"weight_filler" x x
'weight_filler_const_val'"weight_filler_const_val" x x
'weight_filler_variance_norm'"weight_filler_variance_norm" x x

Execution information🔗

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🔗

DLLayerInputDLLayerInputdllayer_input (input_control) dl_layer → (handle)HTuple (HHandle)HDlLayer, HTuple (IntPtr)HHandleHtuple (handle)

Feeding layer.

LayerNamelayerNamelayer_name (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Name of the output layer.

NumOutnumOutnum_out (input_control) number → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of output neurons.

Default: 100100

GenParamNamegenParamNamegen_param_name (input_control) attribute.name(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

Generic input parameter names.

Default: [][]
List of values: 'bias_filler', 'bias_filler_const_val', 'bias_filler_variance_norm', 'bias_term', 'is_inference_output', 'learning_rate_multiplier', 'learning_rate_multiplier_bias', 'weight_filler', 'weight_filler_const_val', 'weight_filler_variance_norm'"bias_filler", "bias_filler_const_val", "bias_filler_variance_norm", "bias_term", "is_inference_output", "learning_rate_multiplier", "learning_rate_multiplier_bias", "weight_filler", "weight_filler_const_val", "weight_filler_variance_norm"

GenParamValuegenParamValuegen_param_value (input_control) attribute.value(-array) → (string / integer / real)HTuple (HString / Hlong / double)HTuple (string / int / long / double)MaybeSequence[Union[int, float, str]]Htuple (char* / Hlong / double)

Generic input parameter values.

Default: [][]
Suggested values: 'xavier', 'msra', 'const', 'nearest_neighbor', 'bilinear', 'norm_in', 'norm_out', 'norm_average', 'true', 'false', 1.0, 0.9, 0.0"xavier", "msra", "const", "nearest_neighbor", "bilinear", "norm_in", "norm_out", "norm_average", "true", "false", 1.0, 0.9, 0.0

DLLayerDenseDLLayerDensedllayer_dense (output_control) dl_layer → (handle)HTuple (HHandle)HDlLayer, HTuple (IntPtr)HHandleHtuple (handle)

Dense layer.

Module🔗

Deep Learning Professional