mpscnnsubtractgradient(3) [mojave man page]
MPSCNNSubtractGradient(3) MetalPerformanceShaders.framework MPSCNNSubtractGradient(3) NAME
MPSCNNSubtractGradient SYNOPSIS
#import <MPSCNNMath.h> Inherits MPSCNNArithmeticGradient. Instance Methods (nonnull instancetype) - initWithDevice: Additional Inherited Members Detailed Description This depends on Metal.framework. Specifies the subtraction gradient operator. This arithmetic gradient filter requires the following inputs: gradient image from the previous layer (going backwards) and either the primary or the secondary source image from the forward pass. You will need a separate filter for the primary and secondary source images. Without broadcasting, the arithmetic subtract gradient operation for the primary source image is a copy operation on the input gradient image (for x - y, d/dx(x - y) = 1). This copy operation can be optimized away by the graph interface. For the secondary source image, the result is a negation of the gradient image from the previous layer (for x - y, d/dy(x - y) = -1). Setting the broadcasting parameters results in a reduction operation (sum) across all of the applicable broadcasting dimensions (rows, columns, feature channels, or any combination thereof) to produce the destination image of the size that matches the primary/secondary input images used in the forward pass. Method Documentation - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device Initialize the subtraction gradient operator. Parameters: device The device the filter will run on. Returns: A valid MPSCNNSubtractGradient object or nil, if failure. Reimplemented from MPSCNNArithmeticGradient. Author Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code. Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSCNNSubtractGradient(3)
Check Out this Related Man Page
MPSCNNPoolingL2NormGradient(3) MetalPerformanceShaders.framework MPSCNNPoolingL2NormGradient(3) NAME
MPSCNNPoolingL2NormGradient SYNOPSIS
#import <MPSCNNPooling.h> Inherits MPSCNNPoolingGradient. Instance Methods (nonnull instancetype) - initWithDevice:kernelWidth:kernelHeight:strideInPixelsX:strideInPixelsY: (nullable instancetype) - initWithCoder:device: Additional Inherited Members Detailed Description This depends on Metal.framework Specifies the filter for computing the gradient of the L2-Norm pooling filter. The operation backpropagates a gradient vector using chain rule. L2-Norm pooling forward pass is defined as: out(x) = sqrt( sum_{dx in Window(x)} in(s*x+dx) * in(s*x+dx) ), where the pooling window definition 'Window(x)' follows MPSCNNPooling specification and 's' is the pixel stride and in() is the source input image. Hence the partial derivative of the output value wrt. to the input value needed in the gradient backpropagation in MPSCNNPoolingGradient is: d out(x)/d in(y) = sum_{dx in Window(x)} delta_{s*x+dx, y} in(s*x+dx) / out(x), where delta_{x,y} is the Kronecker delta symbol for which delta_{x,y} = { 1, when x == y { 0, otherwise, and out(x) is the L2-norm pooling value at point 'x' defined above. Method Documentation - (nullable instancetype) initWithCoder: (NSCoder *__nonnull) aDecoder(nonnull id< MTLDevice >) device NSSecureCoding compatability See MPSKernel::initWithCoder. Parameters: aDecoder The NSCoder subclass with your serialized MPSCNNPoolingL2NormGradient device The MTLDevice on which to make the MPSCNNPoolingL2NormGradient Returns: A new MPSCNNPoolingL2NormGradient object, or nil if failure. Reimplemented from MPSCNNPoolingGradient. - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device(NSUInteger) kernelWidth(NSUInteger) kernelHeight(NSUInteger) strideInPixelsX(NSUInteger) strideInPixelsY Initialize a gradient L2-norm pooling filter Parameters: device The device the filter will run on kernelWidth The width of the kernel. Can be an odd or even value. kernelHeight The height of the kernel. Can be an odd or even value. strideInPixelsX The input stride (upsampling factor) in the x dimension. strideInPixelsY The input stride (upsampling factor) in the y dimension. Returns: A valid MPSCNNPoolingL2NormGradient object or nil, if failure. Reimplemented from MPSCNNPoolingGradient. Author Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code. Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSCNNPoolingL2NormGradient(3)