Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mpscnnsoftmaxgradient(3) [mojave man page]

MPSCNNSoftMaxGradient(3)				 MetalPerformanceShaders.framework				  MPSCNNSoftMaxGradient(3)

NAME
MPSCNNSoftMaxGradient SYNOPSIS
#import <MPSCNNSoftMax.h> Inherits MPSCNNGradientKernel. Instance Methods (nonnull instancetype) - initWithDevice: (nullable instancetype) - initWithCoder:device: Additional Inherited Members Detailed Description This depends on Metal.framework The softMax gradient filter calculates the gradient to be backpropagated. The softMax gradient just as the softMax filter, is applied across feature channels and at all spatial locations. It computes the gradient for a given output generated by the corresponding softMax (i.e. MPSCNNSoftMax) layer and the gradient computed by the previous layer in the back-propagation pass. For each feature channel in an image in a feature map, the softMax gradient filter computes the following: result gradient channel in pixel outputGradient(x,y,k) = softMax(x,y,k) * (inputGradient(x,y,k) - sum(inputGradient(x,y,0) * softMax(x,y,0) ... inputGradient(x,y,N-1) * softMax(x,y,N-1))) where N is the number of feature channels The incoming gradient is the primary source. The original output of corresponding softMax is the secondary source. Method Documentation - (nullable instancetype) initWithCoder: (NSCoder *__nonnull) aDecoder(nonnull id< MTLDevice >) device NSSecureCoding 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. Parameters: aDecoder The NSCoder subclass with your serialized MPSKernel device The MTLDevice on which to make the MPSKernel Returns: A new MPSKernel object, or nil if failure. Reimplemented from MPSCNNGradientKernel. - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device Initializes a MPSCNNSoftMaxGradient function Parameters: device The MTLDevice on which this MPSCNNSoftMaxGradient filter will be used Returns: A valid MPSCNNSoftMaxGradient object or nil, if failure. Reimplemented from MPSCNNGradientKernel. Author Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code. Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSCNNSoftMaxGradient(3)

Check Out this Related Man Page

MPSCNNSpatialNormalizationGradient(3)			 MetalPerformanceShaders.framework		     MPSCNNSpatialNormalizationGradient(3)

NAME
MPSCNNSpatialNormalizationGradient SYNOPSIS
#import <MPSCNNNormalization.h> Inherits MPSCNNGradientKernel. Instance Methods (nonnull instancetype) - initWithDevice:kernelWidth:kernelHeight: (nullable instancetype) - initWithCoder:device: Properties float alpha float beta float delta NSUInteger kernelWidth NSUInteger kernelHeight Additional Inherited Members Detailed Description This depends on Metal.framework Specifies the spatial normalization gradient filter. The spatial normalization for a feature channel applies the filter over local regions which extend spatially, but are in separate feature channels (i.e., they have shape 1 x kernelWidth x kernelHeight). For each feature channel, the function computes the sum of squares of X inside each rectangle, N2(i,j). It then divides each element of X as follows: Y(i,j) = X(i,j) / (delta + alpha/(kw*kh) * N2(i,j))^beta, where kw and kh are the kernelWidth and the kernelHeight. It is the end-users responsibility to ensure that the combination of the parameters delta and alpha does not result in a situation where the denominator becomes zero - in such situations the resulting pixel-value is undefined. T(i,j) = (delta + alpha/(kw*kh) * N2(i,j)) N = kw * kh OutputGradient: dZ/dX(i,j) = T(i,j)^(-beta) * ( dZ/dY(i,j) - (2*alpha*beta*X(i,j)/T(i,j)) * (sum_{l,k in L(i),K(j)} dZ/dY(l,k)*X(l,k)) ) N is the kernel size. The window R(k) itself is defined as: L(i) = [i-floor((kw-1)/2), i+floor(kw/2] K(j) = [j-floor((kh-1)/2), j+floor(kh/2] For correct gradient computation all parameters must be the same as the original normalization filter. Method Documentation - (nullable instancetype) initWithCoder: (NSCoder *__nonnull) aDecoder(nonnull id< MTLDevice >) device NSSecureCoding 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. Parameters: aDecoder The NSCoder subclass with your serialized MPSKernel device The MTLDevice on which to make the MPSKernel Returns: A new MPSKernel object, or nil if failure. Reimplemented from MPSCNNGradientKernel. - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device(NSUInteger) kernelWidth(NSUInteger) kernelHeight Initialize a spatial normalization filter Parameters: device The device the filter will run on kernelWidth The width of the kernel kernelHeight The height of the kernel Returns: A valid MPSCNNSpatialNormalization object or nil, if failure. NOTE: For now, kernelWidth must be equal to kernelHeight Property Documentation - alpha [read], [write], [nonatomic], [assign] The value of alpha. Default is 1.0. Must be non-negative. - beta [read], [write], [nonatomic], [assign] The value of beta. Default is 5.0 - delta [read], [write], [nonatomic], [assign] The value of delta. Default is 1.0 - kernelHeight [read], [nonatomic], [assign] The height of the filter window - kernelWidth [read], [nonatomic], [assign] The width of the filter window Author Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code. Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSCNNSpatialNormalizationGradient(3)
Man Page