Given a p-dimensional tensor X ∈ R n 1 x n 2 x ... x n p , two-dimensional tensor K ∈ R m 1 x m 2 , dimensions k 1 of size m 1 and k 2 of size m 2, and dimension f different from k 1 and k 2, the layer computes the p-dimensional tensor Y ∈ R n 1 x n 2 x ... x n p such that:
See [Jarrett2009] for an exact definition of local contrast normalization.
The library supports four-dimensional input tensors X∈ R n 1 x n 2 x n 3 x n 4 .
Without loss of generality let's assume that forward local contrast normalization is applied to the last two dimensions.
The problem is to compute the tensor Y depending on whether the dimension f is set:
Dimension f is set; let it be n 2:where elements of the weighting window are normalized by the library through dimension f to meet the condition:
Dimension f is not set:where the weighting window meets the condition