Intel(R) Math Kernel Library for Deep Neural Networks (Intel(R) MKL-DNN)  0.21.0
Performance library for Deep Learning
Functions

A primitive to perform local response normalization (LRN) across or within channels. More...

Functions

mkldnn_status_t MKLDNN_API mkldnn_lrn_forward_desc_init (mkldnn_lrn_desc_t *lrn_desc, mkldnn_prop_kind_t prop_kind, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *data_desc, int local_size, float alpha, float beta, float k)
 Initializes an lrn_desc for forward propagation using prop_kind (possible values are mkldnn_forward_training and mkldnn_forward_inference), alg_kind, memory descriptor data_desc, and regularization parameters local_size, alpha, beta, and k. More...
 
mkldnn_status_t MKLDNN_API mkldnn_lrn_backward_desc_init (mkldnn_lrn_desc_t *lrn_desc, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *diff_data_desc, const mkldnn_memory_desc_t *data_desc, int local_size, float alpha, float beta, float k)
 Initializes an lrn_desc for backward propagation using alg_kind, memory descriptors data_desc and diff_data_desc, and regularization parameters local_size, alpha, beta, and k. More...
 

Detailed Description

A primitive to perform local response normalization (LRN) across or within channels.

LRN accross channels:

\[dst[n][c][h][w] = \left\{k + \frac{\alpha}{n_{l}} \sum\limits_{i=-(n_{l}-1)/2}^{(n_{l}+1)/2} (src[n][c+i][h][w])^2\right\}^{-\beta} src[n][c][h][w],\]

LRN within channels:

\[dst[n][c][h][w] = \left\{k + \frac{\alpha}{n_{l}} \sum\limits_{i=-(n_{l}-1)/2}^{(n_{l}+1)/2} (src[n][c][h+i][w+i])^2\right\}^{-\beta} src[n][c][h][w],\]

where $n_{l}$ is the local_size.

During training, LRN might or might not require a workspace on forward (mkldnn_forward_training) and backward (mkldnn_backward) passes. The behavior is implementation specific. Optimized implementations typically require a workspace and use it to save some intermediate results from the forward pass that accelerate computations on the backward pass.

To check whether a workspace is required, query the LRN primitive descriptor for the workspace (mkldnn_query_workspace_pd). Success indicates that the workspace is required and its description will be returned.

See also
mkldnn_primitive_desc_query and mkldnn_primitive_desc_query_pd

Function Documentation

◆ mkldnn_lrn_forward_desc_init()

mkldnn_status_t MKLDNN_API mkldnn_lrn_forward_desc_init ( mkldnn_lrn_desc_t lrn_desc,
mkldnn_prop_kind_t  prop_kind,
mkldnn_alg_kind_t  alg_kind,
const mkldnn_memory_desc_t data_desc,
int  local_size,
float  alpha,
float  beta,
float  k 
)

Initializes an lrn_desc for forward propagation using prop_kind (possible values are mkldnn_forward_training and mkldnn_forward_inference), alg_kind, memory descriptor data_desc, and regularization parameters local_size, alpha, beta, and k.

Order of inputs:

Order of outputs:

◆ mkldnn_lrn_backward_desc_init()

mkldnn_status_t MKLDNN_API mkldnn_lrn_backward_desc_init ( mkldnn_lrn_desc_t lrn_desc,
mkldnn_alg_kind_t  alg_kind,
const mkldnn_memory_desc_t diff_data_desc,
const mkldnn_memory_desc_t data_desc,
int  local_size,
float  alpha,
float  beta,
float  k 
)

Initializes an lrn_desc for backward propagation using alg_kind, memory descriptors data_desc and diff_data_desc, and regularization parameters local_size, alpha, beta, and k.

Order of inputs:

Order of outputs: