MPSCNNConvolution(3)

NAME
MPSCNNConvolution -

SYNOPSIS

#import <MPSCNN.h>

Inherits MPSCNNKernel.

Inherited by MPSCNNFullyConnected.

  Instance Methods
(nonnull instancetype) - initWithDevice:convolutionDescriptor:kernelWeights:biasTerms:flags:
(nonnull instancetype) - initWithDevice:

  Properties
NSUInteger kernelWidth
NSUInteger kernelHeight
NSUInteger inputFeatureChannels
NSUInteger outputFeatureChannels
NSUInteger strideInPixelsX
NSUInteger strideInPixelsY
NSUInteger groups
const MPSCNNNeuron *__nullable neuron

  Additional Inherited Members

Detailed Description

This depends on Metal.framework The MPSCNNConvolution specifies a convolution. The MPSCNNConvolution convolves the input image with a set of filters, each producing one feature map in the output image.

Method Documentation

  - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) NS_DESIGNATED_INITIALIZER
Standard init with default properties per filter type

Parameters:
    device The device that the filter will be used on. May not be NULL.

Returns:
    a pointer to the newly initialized object. This will fail, returning nil if the device is not supported. Devices must be MTLFeatureSet_iOS_GPUFamily2_v1 or later.

Reimplemented from MPSKernel.

Reimplemented in MPSCNNFullyConnected.

  - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device(const MPSCNNConvolutionDescriptor *__nonnull) convolutionDescriptor(const float *__nonnull) kernelWeights(const float *__nullable) biasTerms(MPSCNNConvolutionFlags) NS_DESIGNATED_INITIALIZER
Initializes a convolution kernel

Parameters:
    device The MTLDevice on which this MPSCNNConvolution filter will be used
    convolutionDescriptor A pointer to a MPSCNNConvolutionDescriptor.
    kernelWeights A pointer to a weights array. Each entry is a float value. The number of entries is = inputFeatureChannels * outputFeatureChannels * kernelHeight * kernelWidth The layout of filter weight is so that it can be reinterpreted as 4D tensor (array) weight[ outputChannels ][ kernelHeight ][ kernelWidth ][ inputChannels / groups ] Weights are converted to half float (fp16) internally for best performance.
    biasTerms A pointer to bias terms to be applied to the convolution output. Each entry is a float value. The number of entries is = numberOfOutputFeatureMaps
    flags Currently unused. Pass MPSCNNConvolutionFlagsNone

Returns:
    A valid MPSCNNConvolution object or nil, if failure.

Reimplemented in MPSCNNFullyConnected.

Property Documentation

  - groups [read], [nonatomic], [assign]
Number of groups input and output channels are divided into.

  - inputFeatureChannels [read], [nonatomic], [assign]
The number of feature channels per pixel in the input image.

  - kernelHeight [read], [nonatomic], [assign]
The height of the filter window. Any positive non-zero value is valid, including even values. The position of the top edge of the filter window is given by offset.y - (kernelHeight>>1)

  - kernelWidth [read], [nonatomic], [assign]
The width of the filter window. The position of the left edge of the filter window is given by offset.x - (kernelWidth>>1)

  - neuron [read], [nonatomic], [assign]
MPSCNNNeuron filter to be applied as part of convolution. Can be nil in wich case no neuron activation fuction is applied.

  - outputFeatureChannels [read], [nonatomic], [assign]
The number of feature channels per pixel in the output image.

  - strideInPixelsX [read], [nonatomic], [assign]
The output stride (downsampling factor) in the x dimension. The default value is 1.

  - strideInPixelsY [read], [nonatomic], [assign]
The output stride (downsampling factor) in the y dimension. The default value is 1.

Author

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