local_response_norm#

ivy.local_response_norm(x, size, /, *, bias=1.0, alpha=1.0, beta=0.5, average=False, data_format='NHWC', out=None)[source]#

Apply local response normalization across the channels of a 4D input array. The 4-D array is treated as a 3-D array of 1-D vectors (along the channel dimension), and each vector is normalized independently. Within a given vector, each component is divided by the squared sum of the neighbouring components.

Parameters:
  • x (Union[NativeArray, Array]) – Input array of default shape (N, H, W, C), where N is the batch dimension, H and W correspond to the spatial dimensions and C corresponds to the channel dimension.

  • size – The width of the normalization window.

  • alpha (Optional[float], default: 1.0) – The multiplicative factor.

  • beta (Optional[float], default: 0.5) – The exponent.

  • bias (Optional[float], default: 1.0) – An additive factor.

  • average (bool, default: False) – If True, each component is divided by the averaged squared sum.

  • data_format (Optional[Literal['NHWC', 'NCHW']], default: 'NHWC') – The ordering of the dimensions in the input, either “NHWC” or “NCHW”.

  • out (Optional[Tuple[Array, Array, Array]], default: None) – optional output arrays, for writing the result to.

Return type:

Array

Returns:

ret – The normalized array.