Local-Contrast Normalization Forward Layer

Given a p-dimensional tensor XR n 1 x n 2 x ... x n p , two-dimensional tensor KR 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 YR 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 XR n 1 x n 2 x n 3 x n 4 .

Problem Statement

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

For more complete information about compiler optimizations, see our Optimization Notice.
Select sticky button color: 
Orange (only for download buttons)