local_response_norm¶
dragon.nn.
local_response_norm
(
inputs,
size=5,
alpha=0.0001,
beta=0.75,
bias=1.0,
data_format='NCHW',
**kwargs
)[source]¶Apply the local response normalization. [Krizhevsky et.al, 2012].
The normalization is defined as:
\[y_{i} = x_{i}\left(k + \frac{\alpha}{n} \sum_{j=\max(0, i-n/2)}^{\min(N-1,i+n/2)}x_{j}^2 \right)^{-\beta} \]- Parameters:
- inputs (dragon.Tensor) – The input tensor.
- size (int, optional, default=5) – The number of neighbouring channels to sum over.
- alpha (float, optional, default=0.0001) – The scale value \(\alpha\).
- beta (float, optional, default=0.75) – The exponent value \(\beta\).
- bias (float, optional, default=1.) – The bias constant \(k\).
- data_format (str, optional, default='NCHW') –
'NCHW'
or'NHWC'
.
- Returns:
dragon.Tensor – The output tensor.