.TH "MPSCNNUpsamplingGradient" 3 "Mon Jul 9 2018" "Version MetalPerformanceShaders-119.3" "MetalPerformanceShaders.framework" \" -*- nroff -*- .ad l .nh .SH NAME MPSCNNUpsamplingGradient .SH SYNOPSIS .br .PP .PP \fC#import \fP .PP Inherits \fBMPSCNNGradientKernel\fP\&. .PP Inherited by \fBMPSCNNUpsamplingBilinearGradient\fP, and \fBMPSCNNUpsamplingNearestGradient\fP\&. .SS "Instance Methods" .in +1c .ti -1c .RI "(nonnull instancetype) \- \fBinitWithDevice:\fP" .br .in -1c .SS "Properties" .in +1c .ti -1c .RI "double \fBscaleFactorX\fP" .br .ti -1c .RI "double \fBscaleFactorY\fP" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP This depends on Metal\&.framework The \fBMPSCNNUpsamplingGradient\fP filter is used for training\&. It is the backward filter for the \fBMPSCNNUpsampling\fP filter\&. It operates on the gradient input, specifically, it reduces the size of the gradient input in the x and y dimensions\&. .PP The number of output feature channels remains the same as the number of input feature channels\&. .PP The scaleFactor must be an integer value >= 1\&. The default value is 1\&. If scaleFactor == 1, the filter acts as a copy kernel\&. .PP Nearest and bilinear variants are supported\&. .PP For example, for the nearest variant with scaleFactorX = scaleFactorY = 2, the forward pass produced the following output: .PP Input: Output: a a b b a b a a b b c d c c d d c c d d .PP To upsample the image, the input data is replicated\&. .PP And, the backward pass for the above froward pass is computed in the following way: .PP Input: Output: a1 a2 b1 b2 a2 a3 b3 b4 x y c1 c2 d1 d2 z w c3 c4 d3 d4 .PP where x = a1 + a2 + a3 + a4 y = b1 + b2 + b3 + b4 z = c1 + c2 + c3 + c4 w = d1 + d2 + d3 + d4 .SH "Method Documentation" .PP .SS "\- (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device" Standard init with default properties per filter type .PP \fBParameters:\fP .RS 4 \fIdevice\fP The device that the filter will be used on\&. May not be NULL\&. .RE .PP \fBReturns:\fP .RS 4 \fBA\fP 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\&. .RE .PP .PP Reimplemented from \fBMPSCNNGradientKernel\fP\&. .SH "Property Documentation" .PP .SS "\- scaleFactorX\fC [read]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" The downsampling scale factor for the x dimension\&. The default value is 1\&. .SS "\- scaleFactorY\fC [read]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" The downsampling scale factor for the y dimension\&. The default value is 1\&. .SH "Author" .PP Generated automatically by Doxygen for MetalPerformanceShaders\&.framework from the source code\&.