<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSCNNCrossChannelNormalization",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSCNNCrossChannelNormalization"
  },
  "title" : "MPSCNNCrossChannelNormalization"
}
-->

# MPSCNNCrossChannelNormalization

A normalization kernel applied across feature channels.

```
class MPSCNNCrossChannelNormalization
```

## Overview

The normalization kernel applies the kernel to a local region across nearby feature channels, but with no spatial extent (i.e., they have the shape `kernel size x 1 x 1`). The normalized output is given by the function:

![Y(i,j,k) = X(i,j,k) / L(i,j,k)^beta](images/com.apple.metalperformanceshaders/media-2903526@2x.png)

Where the normalizing factor is:

![L(i,j,k) = delta + alpha/N * (sum_{q in Q(k)} X(i,j,q)^2](images/com.apple.metalperformanceshaders/media-2903524@2x.png)

Where `N` is the kernel size. The window `Q(k)` itself is defined as:

![Q(k) = [max(0, k-floor(N/2)), min(D-1, k+floor((N-1)/2)]](images/com.apple.metalperformanceshaders/media-2903527@2x.png)

Where `k` is the feature channel index (running from 0 to `D-1`) and `D` is the number of feature channels, and the values of [`alpha`](/documentation/MetalPerformanceShaders/MPSCNNCrossChannelNormalization/alpha), [`beta`](/documentation/MetalPerformanceShaders/MPSCNNCrossChannelNormalization/beta), and [`delta`](/documentation/MetalPerformanceShaders/MPSCNNCrossChannelNormalization/delta) are set via properties.

It is your responsibility to ensure that the combination of the values of the [`delta`](/documentation/MetalPerformanceShaders/MPSCNNCrossChannelNormalization/delta) and [`alpha`](/documentation/MetalPerformanceShaders/MPSCNNCrossChannelNormalization/alpha) properties does not result in a situation where the denominator becomes zero - in such situations the resulting pixel-value is undefined.

> Note:
> The encoding methods in the ``doc://com.apple.metalperformanceshaders/documentation/MetalPerformanceShaders/MPSUnaryImageKernel`` class can be used to encode an ``doc://com.apple.metalperformanceshaders/documentation/MetalPerformanceShaders/MPSCNNCrossChannelNormalization`` object to a <doc://com.apple.documentation/documentation/Metal/MTLCommandBuffer> object.

## Topics

### Initializers

[`init(coder:device:)`](/documentation/MetalPerformanceShaders/MPSCNNCrossChannelNormalization/init(coder:device:))

Initializes a normalization kernel in a channel.

[`init(device:kernelSize:)`](/documentation/MetalPerformanceShaders/MPSCNNCrossChannelNormalization/init(device:kernelSize:))

Initializes a normalization kernel in a channel.

### Instance Properties

[`alpha`](/documentation/MetalPerformanceShaders/MPSCNNCrossChannelNormalization/alpha)

The “alpha” variable of the kernel function.

[`beta`](/documentation/MetalPerformanceShaders/MPSCNNCrossChannelNormalization/beta)

The “beta” variable of the kernel function.

[`delta`](/documentation/MetalPerformanceShaders/MPSCNNCrossChannelNormalization/delta)

The “delta” variable of the kernel function.

[`kernelSize`](/documentation/MetalPerformanceShaders/MPSCNNCrossChannelNormalization/kernelSize)

The size of the square kernel window.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)