MPSCNNInstanceNormalization(3)

NAME
MPSCNNInstanceNormalization

SYNOPSIS

#import <MPSCNNInstanceNormalization.h>

Inherits MPSCNNKernel.

  Instance Methods
(nonnull instancetype) - initWithDevice:dataSource:
(nonnull instancetype) - initWithDevice:
(nullable instancetype) - initWithCoder:device:
(void) - reloadDataSource:
(void) - reloadGammaAndBetaFromDataSource
(void) - reloadGammaAndBetaWithCommandBuffer:gammaAndBetaState:
(MPSCNNInstanceNormalizationGradientState *__nullable) - resultStateForSourceImage:sourceStates:destinationImage:
(MPSCNNInstanceNormalizationGradientState *__nullable) - temporaryResultStateForCommandBuffer:sourceImage:sourceStates:destinationImage:

  Properties
float epsilon
id< MPSCNNInstanceNormalizationDataSource > dataSource

  Additional Inherited Members

Detailed Description

This depends on Metal.framework This kernel normalizes each image, on a per-channel basis, to have zero mean and unit variance:

for each image: for each channel: y = (x - mean) * gamma / sqrt(variance + epsilon) + beta;

Method Documentation

  - (nullable instancetype) initWithCoder: (NSCoder *__nonnull) aDecoder(nonnull id< MTLDevice >) device
NSSecureCoding compatability While the standard NSSecureCoding/NSCoding method -initWithCoder: should work, since the file can't know which device your data is allocated on, we have to guess and may guess incorrectly. To avoid that problem, use initWithCoder:device instead.

Parameters:
    aDecoder The NSCoder subclass with your serialized MPSKernel
    device The MTLDevice on which to make the MPSKernel

Returns:
    A new MPSCNNInstanceNormalization object, or nil if failure.

Reimplemented from MPSCNNKernel.

  - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device
Use initWithDevice:dataSource instead

Reimplemented from MPSCNNKernel.

  - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device(nonnull id< MPSCNNInstanceNormalizationDataSource >) dataSource
Initialize a MPSCNNInstanceNormalization kernel on a device.

Parameters:
    dataSource An object conforming to the MPSCNNInstanceNormalizationDataSource protocol which

  - (void) reloadDataSource: (__nonnull id< MPSCNNInstanceNormalizationDataSource >) dataSource
Reload data using a data source.

Parameters:
    dataSource The data source which will provide the gamma and beta terms to scale and bias the normalized result respectively.

  - (void) reloadGammaAndBetaFromDataSource
Reinitialize the filter using the data source provided at kernel initialization.

  - (void) reloadGammaAndBetaWithCommandBuffer: (__nonnull id< MTLCommandBuffer >) commandBuffer(MPSCNNNormalizationGammaAndBetaState *__nonnull) gammaAndBetaState
Reload data using new gamma and beta terms contained within an MPSCNNInstanceNormalizationGradientState object.

Parameters:
    commandBuffer The command buffer on which to encode the reload.
    gammaAndBetaState The state containing the updated weights which are to be reloaded.

  - (MPSCNNInstanceNormalizationGradientState * __nullable) resultStateForSourceImage: (MPSImage *__nonnull) sourceImage(NSArray< MPSState * > *__nullable) sourceStates(MPSImage *__nonnull) destinationImage
Return a MPSCNNInstanceNormalizationGradientState object for the provided source image, source states, and destination image.

Reimplemented from MPSCNNKernel.

  - (MPSCNNInstanceNormalizationGradientState * __nullable) temporaryResultStateForCommandBuffer: (nonnull id< MTLCommandBuffer >) commandBuffer(MPSImage *__nonnull) sourceImage(NSArray< MPSState * > *__nullable) sourceStates(MPSImage *__nonnull) destinationImage
Return a temporary MPSCNNInstanceNormalizationGradientState object which may be used with a MPSCNNInstanceNormalization filter.

Reimplemented from MPSCNNKernel.

Property Documentation

  - (id<MPSCNNInstanceNormalizationDataSource>) dataSource [read], [nonatomic], [retain]
The data source that the object was initialized with

  - epsilon [read], [write], [nonatomic], [assign]
The epsilon value used to bias the variance when normalizing.

Author

Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.