MPSCNNConvolutionWeightsAndBiasesState(3) MetalPerformanceShaders.framework MPSCNNConvolutionWeightsAndBiasesState(3)

MPSCNNConvolutionWeightsAndBiasesState

#import <MPSCNNConvolution.h>

Inherits MPSState.


(nonnull instancetype) - initWithWeights:biases:
(nonnull instancetype) - initWithDevice:cnnConvolutionDescriptor:


(nonnull instancetype) + temporaryCNNConvolutionWeightsAndBiasesStateWithCommandBuffer:cnnConvolutionDescriptor:


__nonnull id< MTLBuffer > weights
__nullable id< MTLBuffer > biases

The MPSCNNConvolutionWeightsAndBiasesState is returned by exportWeightsAndBiasesWithCommandBuffer: method on MPSCNNConvolution object. This is mainly used for GPU side weights/biases update process. During training, application can keep a copy of weights, velocity, momentum MTLBuffers in its data source, update the weights (in-place or out of place) with gradients obtained from MPSCNNConvolutionGradientState and call [MPSCNNConvolution reloadWeightsAndBiasesWithCommandBuffer] with resulting updated MTLBuffer. If application does not want to keep a copy of weights/biases, it can call [MPSCNNConvolution exportWeightsAndBiasesWithCommandBuffer:] to get the current weights from convolution itself, do the updated and call reloadWithCommandBuffer.

- (nonnull instancetype) initWithDevice: (__nonnull id< MTLDevice >) device(MPSCNNConvolutionDescriptor *__nonnull) descriptor

- (nonnull instancetype) initWithWeights: (__nonnull id< MTLBuffer >) weights(__nullable id< MTLBuffer >) biases

- biases [read], [nonatomic], [assign]

A buffer that contains the biases. Each value is float and there are ouputFeatureChannels values.

- weights [read], [nonatomic], [assign]

A buffer that contains the weights. Each value in the buffer is a float. The layout of the weights with respect to the weights is the same as the weights layout provided by data source i.e. it can be interpreted as 4D array


weights[outputFeatureChannels][kernelHeight][kernelWidth][inputFeatureChannels/groups]

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

Mon Jul 9 2018 Version MetalPerformanceShaders-119.3