.TH "MPSCNNBatchNormalizationStatistics" 3 "Mon Jul 9 2018" "Version MetalPerformanceShaders-119.3" "MetalPerformanceShaders.framework" \" -*- nroff -*- .ad l .nh .SH NAME MPSCNNBatchNormalizationStatistics .SH SYNOPSIS .br .PP .PP \fC#import \fP .PP Inherits \fBMPSCNNKernel\fP\&. .SS "Instance Methods" .in +1c .ti -1c .RI "(nonnull instancetype) \- \fBinitWithDevice:\fP" .br .ti -1c .RI "(nullable instancetype) \- \fBinitWithCoder:device:\fP" .br .ti -1c .RI "(void) \- \fBencodeBatchToCommandBuffer:sourceImages:batchNormalizationState:\fP" .br .ti -1c .RI "(void) \- \fBencodeBatchToCommandBuffer:sourceImages:destinationImages:\fP" .br .ti -1c .RI "(void) \- \fBencodeToCommandBuffer:sourceImage:destinationImage:\fP" .br .ti -1c .RI "(\fBMPSImage\fP *__nonnull) \- \fBencodeToCommandBuffer:sourceImage:\fP" .br .ti -1c .RI "(\fBMPSImageBatch\fP *__nonnull) \- \fBencodeBatchToCommandBuffer:sourceImages:\fP" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP This depends on Metal\&.framework \fBMPSCNNBatchNormalizationStatistics\fP updates a \fBMPSCNNBatchNormalizationState\fP with the batch statistics necessary to perform a batch normalization\&. \fBMPSCNNBatchNormalizationStatistics\fP may be executed multiple times with multiple images to accumulate all the statistics necessary to perform a batch normalization as described in https://arxiv.org/pdf/1502.03167v3.pdf\&. .SH "Method Documentation" .PP .SS "\- (\fBMPSImageBatch\fP * __nonnull) encodeBatchToCommandBuffer: (nonnull id< MTLCommandBuffer >) commandBuffer(\fBMPSImageBatch\fP *__nonnull) sourceImages" Encode a \fBMPSCNNKernel\fP into a command Buffer\&. Create a texture to hold the result and return it\&. In the first iteration on this method, encodeToCommandBuffer:sourceImage:destinationImage: some work was left for the developer to do in the form of correctly setting the offset property and sizing the result buffer\&. With the introduction of the padding policy (see padding property) the filter can do this work itself\&. If you would like to have some input into what sort of \fBMPSImage\fP (e\&.g\&. temporary vs\&. regular) or what size it is or where it is allocated, you may set the destinationImageAllocator to allocate the image yourself\&. .PP This method uses the \fBMPSNNPadding\fP padding property to figure out how to size the result image and to set the offset property\&. See discussion in \fBMPSNeuralNetworkTypes\&.h\fP\&. All images in a batch must have \fBMPSImage\&.numberOfImages\fP = 1\&. .PP \fBParameters:\fP .RS 4 \fIcommandBuffer\fP The command buffer .br \fIsourceImages\fP \fBA\fP MPSImages to use as the source images for the filter\&. .RE .PP \fBReturns:\fP .RS 4 An array of MPSImages or MPSTemporaryImages allocated per the destinationImageAllocator containing the output of the graph\&. The offset property will be adjusted to reflect the offset used during the encode\&. The returned images will be automatically released when the command buffer completes\&. If you want to keep them around for longer, retain the images\&. .RE .PP .PP Reimplemented from \fBMPSCNNKernel\fP\&. .SS "\- (void) encodeBatchToCommandBuffer: (__nonnull id< MTLCommandBuffer >) commandBuffer(\fBMPSImageBatch\fP *__nonnull) sourceImages(\fBMPSCNNBatchNormalizationState\fP *__nonnull) batchNormalizationState" Encode this operation to a command buffer\&. .PP \fBParameters:\fP .RS 4 \fIcommandBuffer\fP The command buffer\&. .br \fIsourceImages\fP An MPSImageBatch containing the source images\&. .br \fIbatchNormalizationState\fP \fBA\fP valid \fBMPSCNNBatchNormalizationState\fP object which will be updated with the image batch statistics\&. .RE .PP .SS "\- (void) encodeBatchToCommandBuffer: (__nonnull id< MTLCommandBuffer >) commandBuffer(\fBMPSImageBatch\fP *__nonnull) sourceImages(\fBMPSImageBatch\fP *__nonnull) destinationImages" .SS "\- (\fBMPSImage\fP * __nonnull) encodeToCommandBuffer: (__nonnull id< MTLCommandBuffer >) commandBuffer(\fBMPSImage\fP *__nonnull) sourceImage" .SS "\- (void) encodeToCommandBuffer: (__nonnull id< MTLCommandBuffer >) commandBuffer(\fBMPSImage\fP *__nonnull) sourceImage(\fBMPSImage\fP *__nonnull) destinationImage" .SS "\- (nullable instancetype) \fBinitWithCoder:\fP (NSCoder *__nonnull) aDecoder(nonnull id< MTLDevice >) device" \fBNSSecureCoding\fP 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\&. .PP \fBParameters:\fP .RS 4 \fIaDecoder\fP The NSCoder subclass with your serialized \fBMPSKernel\fP .br \fIdevice\fP The MTLDevice on which to make the \fBMPSKernel\fP .RE .PP \fBReturns:\fP .RS 4 \fBA\fP new \fBMPSCNNBatchNormalizationStatistics\fP object, or nil if failure\&. .RE .PP .PP Reimplemented from \fBMPSCNNKernel\fP\&. .SS "\- (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device" Initialize this kernel on a device\&. .PP \fBParameters:\fP .RS 4 \fIdevice\fP The MTLDevice on which to initialize the kernel\&. .RE .PP .PP Reimplemented from \fBMPSCNNKernel\fP\&. .SH "Author" .PP Generated automatically by Doxygen for MetalPerformanceShaders\&.framework from the source code\&.