Class

MPSCNNSpatialNormalization

A spatial normalization kernel.

Declaration

@interface MPSCNNSpatialNormalization : MPSCNNKernel

Overview

The spatial normalization for a feature channel applies the kernel over local regions which extend spatially, but are in separate feature channels (i.e., they have the shape 1 x kernel width x kernel height).

For each feature channel, the function computes the sum of squares of X inside each rectangle, N2(i,j). It then divides each element of X as follows:

Y(i,j) = X(i,j) / (delta + alpha/(kw*kh) * N2(i,j))^beta

Where kw and kh are the values of the kernelWidth and kernelHeight properties, respectively. It is your responsibility to ensure that the combination of the values of the delta and alphakernelWidthkernelHeight properties does not result in a situation where the denominator becomes zero (in such situations the resulting pixel-value is undefined).

Topics

Instance Properties

alpha

The "alpha" variable of the kernel function.

beta

The "beta" variable of the kernel function.

delta

The "delta" variable of the kernel function.

Instance Methods

- initWithDevice:kernelWidth:kernelHeight:

Initializes a spatial normalization kernel.

Relationships

Inherits From

See Also

Normalization Layers

MPSCNNCrossChannelNormalization

A normalization kernel applied across feature channels.

MPSCNNCrossChannelNormalizationGradient

A gradient normalization kernel applied across feature channels.

MPSCNNLocalContrastNormalization

A local-contrast normalization kernel.

MPSCNNLocalContrastNormalizationGradient

A gradient local-contrast normalization kernel.

MPSCNNSpatialNormalizationGradient

A gradient spatial normalization kernel.

MPSCNNBatchNormalization

A batch normalization kernel.

MPSCNNBatchNormalizationGradient

A gradient batch normalization kernel.

MPSCNNBatchNormalizationState

An object that stores data required to execute batch normalization.

MPSCNNNormalizationMeanAndVarianceState

An object that stores mean and variance terms used to execute batch normalization.

MPSCNNBatchNormalizationStatistics

An object that stores statistics required to execute batch normalization.

MPSCNNBatchNormalizationStatisticsGradient

An object that stores the gradient of the loss function with respect to the batch statistics and batch normalization weights.

MPSCNNInstanceNormalization

An instance normalization kernel.

MPSCNNInstanceNormalizationGradient

A gradient instance normalization kernel.

MPSCNNInstanceNormalizationGradientState

An object that stores information required to execute a gradient pass for instance normalization.

MPSCNNNormalizationGammaAndBetaState

An object that stores gamma and beta terms used to apply a scale and bias in instance- or batch-normalization operations.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software