create_dl_layer_denseT_create_dl_layer_denseCreateDlLayerDenseCreateDlLayerDensecreate_dl_layer_dense (Operator)
Name
create_dl_layer_denseT_create_dl_layer_denseCreateDlLayerDenseCreateDlLayerDensecreate_dl_layer_dense
— Create a dense layer.
Signature
void CreateDlLayerDense(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)
static void HOperatorSet.CreateDlLayerDense(HTuple DLLayerInput, HTuple layerName, HTuple numOut, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerDense)
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_densecreate_dl_layer_denseCreateDlLayerDenseCreateDlLayerDensecreate_dl_layer_dense
creates a dense or fully connected
layer (sometimes also called gemm) with NumOutNumOutNumOutnumOutnum_out
output neurons whose
handle is returned in DLLayerDenseDLLayerDenseDLLayerDenseDLLayerDensedllayer_dense
.
The parameter DLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input
determines the feeding input layer and
expects the layer handle as value.
The parameter LayerNameLayerNameLayerNamelayerNamelayer_name
sets an individual layer name.
Note that if creating a model using create_dl_modelcreate_dl_modelCreateDlModelCreateDlModelcreate_dl_model
each layer of
the created network must have a unique name.
The following generic parameters GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
and the corresponding
values GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
are supported:
- 'bias_filler'"bias_filler""bias_filler""bias_filler""bias_filler":
-
See create_dl_layer_convolutioncreate_dl_layer_convolutionCreateDlLayerConvolutionCreateDlLayerConvolutioncreate_dl_layer_convolution
for a detailed explanation of
this parameter and its values.
List of values: 'xavier'"xavier""xavier""xavier""xavier", 'msra'"msra""msra""msra""msra",
'const'"const""const""const""const".
Default: 'const'"const""const""const""const"
- 'bias_filler_const_val'"bias_filler_const_val""bias_filler_const_val""bias_filler_const_val""bias_filler_const_val":
-
Constant value if
'bias_filler'"bias_filler""bias_filler""bias_filler""bias_filler" = 'const'"const""const""const""const".
Default: 0
- 'bias_filler_variance_norm'"bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm":
-
See create_dl_layer_convolutioncreate_dl_layer_convolutionCreateDlLayerConvolutionCreateDlLayerConvolutioncreate_dl_layer_convolution
for a detailed explanation of
this parameter and its values.
List of values: 'norm_out'"norm_out""norm_out""norm_out""norm_out", 'norm_in'"norm_in""norm_in""norm_in""norm_in",
'norm_average'"norm_average""norm_average""norm_average""norm_average", or constant value (in combination with
'bias_filler'"bias_filler""bias_filler""bias_filler""bias_filler" = 'msra'"msra""msra""msra""msra").
Default: 'norm_out'"norm_out""norm_out""norm_out""norm_out"
- 'bias_term'"bias_term""bias_term""bias_term""bias_term":
-
Determines whether the created dense
layer has a bias term ('true'"true""true""true""true") or not ('false'"false""false""false""false").
Default: 'true'"true""true""true""true"
- '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"
- 'learning_rate_multiplier'"learning_rate_multiplier""learning_rate_multiplier""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""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier" is set to 0.0, the layer is
skipped during training.
Default: 1.0
- 'learning_rate_multiplier_bias'"learning_rate_multiplier_bias""learning_rate_multiplier_bias""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""learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias" and
'learning_rate_multiplier'"learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier".
Default: 1.0
- 'weight_filler'"weight_filler""weight_filler""weight_filler""weight_filler":
-
See create_dl_layer_convolutioncreate_dl_layer_convolutionCreateDlLayerConvolutionCreateDlLayerConvolutioncreate_dl_layer_convolution
for a detailed explanation of
this parameter and its values.
List of values: 'xavier'"xavier""xavier""xavier""xavier", 'msra'"msra""msra""msra""msra",
'const'"const""const""const""const".
Default: 'xavier'"xavier""xavier""xavier""xavier"
- 'weight_filler_const_val'"weight_filler_const_val""weight_filler_const_val""weight_filler_const_val""weight_filler_const_val":
-
See create_dl_layer_convolutioncreate_dl_layer_convolutionCreateDlLayerConvolutionCreateDlLayerConvolutioncreate_dl_layer_convolution
for a detailed explanation of
this parameter and its values.
Default: 0.5
- 'weight_filler_variance_norm'"weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm":
-
See create_dl_layer_convolutioncreate_dl_layer_convolutionCreateDlLayerConvolutionCreateDlLayerConvolutioncreate_dl_layer_convolution
for a detailed explanation of
this parameter and its values.
List of values: 'norm_in'"norm_in""norm_in""norm_in""norm_in", 'norm_out'"norm_out""norm_out""norm_out""norm_out",
'norm_average'"norm_average""norm_average""norm_average""norm_average", or constant value (in combination with
'bias_filler'"bias_filler""bias_filler""bias_filler""bias_filler" = 'msra'"msra""msra""msra""msra").
Default: 'norm_in'"norm_in""norm_in""norm_in""norm_in"
Certain parameters of layers created using
create_dl_layer_densecreate_dl_layer_denseCreateDlLayerDenseCreateDlLayerDensecreate_dl_layer_dense
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
.
Generic Layer Parameters |
set |
get |
'bias_filler'"bias_filler""bias_filler""bias_filler""bias_filler" |
x |
x
|
'bias_filler_const_val'"bias_filler_const_val""bias_filler_const_val""bias_filler_const_val""bias_filler_const_val" |
x |
x
|
'bias_filler_variance_norm'"bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm" |
x |
x
|
'bias_term'"bias_term""bias_term""bias_term""bias_term" |
|
x
|
'is_inference_output'"is_inference_output""is_inference_output""is_inference_output""is_inference_output" |
x |
x
|
'learning_rate_multiplier'"learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier" |
x |
x
|
'learning_rate_multiplier_bias'"learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias" |
x |
x
|
'num_trainable_params'"num_trainable_params""num_trainable_params""num_trainable_params""num_trainable_params" |
|
x
|
'weight_filler'"weight_filler""weight_filler""weight_filler""weight_filler" |
x |
x
|
'weight_filler_const_val'"weight_filler_const_val""weight_filler_const_val""weight_filler_const_val""weight_filler_const_val" |
x |
x
|
'weight_filler_variance_norm'"weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm" |
x |
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
DLLayerInputDLLayerInputDLLayerInputDLLayerInputdllayer_input
(input_control) dl_layer →
HDlLayer, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Feeding layer.
LayerNameLayerNameLayerNamelayerNamelayer_name
(input_control) string →
HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Name of the output layer.
NumOutNumOutNumOutnumOutnum_out
(input_control) number →
HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Number of output neurons.
Default:
100
GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
(input_control) attribute.name(-array) →
HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Generic input parameter names.
Default:
[]
List of values:
'bias_filler'"bias_filler""bias_filler""bias_filler""bias_filler", 'bias_filler_const_val'"bias_filler_const_val""bias_filler_const_val""bias_filler_const_val""bias_filler_const_val", 'bias_filler_variance_norm'"bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm""bias_filler_variance_norm", 'bias_term'"bias_term""bias_term""bias_term""bias_term", 'is_inference_output'"is_inference_output""is_inference_output""is_inference_output""is_inference_output", 'learning_rate_multiplier'"learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier""learning_rate_multiplier", 'learning_rate_multiplier_bias'"learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias""learning_rate_multiplier_bias", 'weight_filler'"weight_filler""weight_filler""weight_filler""weight_filler", 'weight_filler_const_val'"weight_filler_const_val""weight_filler_const_val""weight_filler_const_val""weight_filler_const_val", 'weight_filler_variance_norm'"weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm""weight_filler_variance_norm"
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:
'xavier'"xavier""xavier""xavier""xavier", 'msra'"msra""msra""msra""msra", 'const'"const""const""const""const", 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor", 'bilinear'"bilinear""bilinear""bilinear""bilinear", 'norm_in'"norm_in""norm_in""norm_in""norm_in", 'norm_out'"norm_out""norm_out""norm_out""norm_out", 'norm_average'"norm_average""norm_average""norm_average""norm_average", 'true'"true""true""true""true", 'false'"false""false""false""false", 1.0, 0.9, 0.0
DLLayerDenseDLLayerDenseDLLayerDenseDLLayerDensedllayer_dense
(output_control) dl_layer →
HDlLayer, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Dense layer.
Module
Deep Learning Training