Skip to content

create_dl_layer_lrnCreateDlLayerLrnCreateDlLayerLrncreate_dl_layer_lrnT_create_dl_layer_lrn🔗

Short description🔗

create_dl_layer_lrnCreateDlLayerLrnCreateDlLayerLrncreate_dl_layer_lrnT_create_dl_layer_lrn — Create a LRN layer.

Signature🔗

create_dl_layer_lrn( dl_layer DLLayerInput, string LayerName, number LocalSize, number Alpha, number Beta, number K, string NormRegion, attribute.name GenParamName, attribute.value GenParamValue, out dl_layer DLLayerLRN )void CreateDlLayerLrn( const HTuple& DLLayerInput, const HTuple& LayerName, const HTuple& LocalSize, const HTuple& Alpha, const HTuple& Beta, const HTuple& K, const HTuple& NormRegion, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerLRN )static void HOperatorSet.CreateDlLayerLrn( HTuple DLLayerInput, HTuple layerName, HTuple localSize, HTuple alpha, HTuple beta, HTuple k, HTuple normRegion, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerLRN )def create_dl_layer_lrn( dllayer_input: HHandle, layer_name: str, local_size: int, alpha: float, beta: float, k: float, norm_region: str, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]] ) -> HHandle

Herror T_create_dl_layer_lrn( const Htuple DLLayerInput, const Htuple LayerName, const Htuple LocalSize, const Htuple Alpha, const Htuple Beta, const Htuple K, const Htuple NormRegion, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DLLayerLRN )

HDlLayer HDlLayer::CreateDlLayerLrn( const HString& LayerName, Hlong LocalSize, double Alpha, double Beta, double K, const HString& NormRegion, const HTuple& GenParamName, const HTuple& GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerLrn( const HString& LayerName, Hlong LocalSize, double Alpha, double Beta, double K, const HString& NormRegion, const HString& GenParamName, const HString& GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerLrn( const char* LayerName, Hlong LocalSize, double Alpha, double Beta, double K, const char* NormRegion, const char* GenParamName, const char* GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerLrn( const wchar_t* LayerName, Hlong LocalSize, double Alpha, double Beta, double K, const wchar_t* NormRegion, const wchar_t* GenParamName, const wchar_t* GenParamValue ) const (Windows only)

HDlLayer HDlLayer.CreateDlLayerLrn( string layerName, int localSize, double alpha, double beta, double k, string normRegion, HTuple genParamName, HTuple genParamValue )

HDlLayer HDlLayer.CreateDlLayerLrn( string layerName, int localSize, double alpha, double beta, double k, string normRegion, string genParamName, string genParamValue )

Description🔗

The operator create_dl_layer_lrnCreateDlLayerLrn creates a local response normalization layer which performs normalization over a local window and whose handle is returned in DLLayerLRNDLLayerLRNdllayer_lrn. Currently, for NormRegionnormRegionnorm_region only 'across_channels'"across_channels" can be set, which results in a normalization across the channel dimension. More detailed, a value \(x_{c}\) located in a channel with index \(c\) is normalized with a scale factor depending on a local window,

\[\begin{eqnarray*} LRN(x_{c}) = x_{c} \cdot \left( \textrm{K} + \frac{\textrm{Alpha}}{n} \sum_{c'=\max(0, c-n/2)}^{\min(N-1, c+n/2)} x_{c'}^2 \right)^{-\textrm{Beta}} , \end{eqnarray*}\]

where \(n\) is the size of the local window given by LocalSizelocalSizelocal_size, \(N\) is the total number of channels, Alphaalphaalpha is the scaling parameter (used as a normalization constant), Betabetabeta is the exponent used as a contrast constant, and Kkk is a constant summand, which is used to avoid any singularities.

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:

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

Certain parameters of layers created using this operator create_dl_layer_lrnCreateDlLayerLrn 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
'alpha'"alpha" (Alphaalphaalpha) x
'beta'"beta" (Betabetabeta) x
'input_layer'"input_layer" (DLLayerInputDLLayerInputdllayer_input) x
'k'"k" (Kkk) x
'local_size'"local_size" (LocalSizelocalSizelocal_size) x
'name'"name" (LayerNamelayerNamelayer_name) x x
'norm_region'"norm_region" (NormRegionnormRegionnorm_region) x
'output_layer'"output_layer" (DLLayerLRNDLLayerLRNdllayer_lrn) x
'shape'"shape" x
'type'"type" x
Generic Layer Parameters set get
'is_inference_output'"is_inference_output" x x
'num_trainable_params'"num_trainable_params" 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.

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

Size of the local window.

Default: 55

Alphaalphaalpha (input_control) number → (real)HTuple (double)HTuple (double)floatHtuple (double)

Scaling factor in the LRN formula.

Default: 0.00010.0001

Betabetabeta (input_control) number → (real)HTuple (double)HTuple (double)floatHtuple (double)

Exponent in the LRN formula.

Default: 0.750.75

Kkk (input_control) number → (real)HTuple (double)HTuple (double)floatHtuple (double)

Constant summand in the LRN formula.

Default: 1.01.0

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

Normalization dimension.

Default: 'across_channels'"across_channels"

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: 'is_inference_output'"is_inference_output"

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: 'true', 'false'"true", "false"

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

LRN layer.

Module🔗

Deep Learning Professional