CLrnLayer Class
July 7, 2021 ยท View on GitHub
The class implements a layer that performs local response normalization using the following formula:
LRN(x)[obj][ch] = x[obj][ch] * / ((bias + alpha * sqrSum[obj][ch] / windowSize) ^ beta)
where:
objis index of object[0; BlobSize / Channels)chis index of channel[0; Channels)windowSize,bias,alpha,betaare settingssqrSumis calculated using the following formula:
sqrSum(x)[obj][ch] = sum(x[obj][i] * x[obj][i] for each i in [ch_min, ch_max])
ch_min = max(0, ch - floor((windowSize - 1)/2))
ch_max = min(C - 1, ch + ceil((windowSize - 1)/2))
Settings
Window size
void SetWindowSize( int value );
Sets size of the window used during the calculation of sqrSum.
Bias
void SetBias( float value );
Sets the bias value, which is added to the scaled sum of squares.
Scale (alpha)
void SetAlpha( float value );
Sets the scale value. The sum of squares is multiplied by this value.
Exponent (beta)
void SetBeta( float value );
Sets the exponent, used in the formula.
Trainable parameters
There are no trainable parameters for this layer.
Inputs
The single input accepts a blob of any size.
Outputs
The single output contains a blob of the same size with the results of local response normalization.