MPSMatrixSoftMaxGradient(3) | MetalPerformanceShaders.framework | MPSMatrixSoftMaxGradient(3) |
MPSMatrixSoftMaxGradient
#import <MPSMatrixSoftMax.h>
Inherits MPSMatrixBinaryKernel.
Inherited by MPSMatrixLogSoftMaxGradient.
(nonnull instancetype) - initWithDevice:
(void) -
encodeToCommandBuffer:gradientMatrix:forwardOutputMatrix:resultMatrix:
(nullable instancetype) - initWithCoder:device:
(nonnull instancetype) - copyWithZone:device:
NSUInteger sourceRows
NSUInteger sourceColumns
This depends on Metal.framework.
Computes the gradient corresponding to a forward MPSMatrixSoftMax object.
A MPSMatrixSoftMaxGradient object computes:
dL_dX_ij = Y_ij * (dL_dY_ij - sum_k(dL_dY_ik * Y_ik)
Where dL_dX is the resulting gradient of the loss function with respect to
the original input to the forward MPSMatrixSoftMax operation, Y is
the output of the forward MPSMatrixSoftMax operation, and dL_dY is the
gradient of the loss function with respect to Y.
Make a copy of this kernel for a new device -
See also:
Parameters:
Returns:
Reimplemented from MPSKernel.
Encode a MPSMatrixSoftMaxGradient object to a command buffer.
Parameters:
NSSecureCoding compatability See MPSKernel::initWithCoder.
Parameters:
Returns:
Reimplemented from MPSKernel.
Initialize an MPSMatrixSoftMaxGradient object on a device.
Parameters:
Returns:
Reimplemented from MPSKernel.
The number of columns to consider from the sources in the operation. This property is modifiable and defaults to NSUIntegerMax and the number is adjusted dynamically at kernel encode time (see encodeToCommandBuffer) to fit into the source matrices available starting from [primary/secondary]SourceMatrixOrigin.y, indicating that by default the whole source matrix is used. If a different size is desired then this should be modified prior to encoding the kernel. It is the user's responsibility to ensure that the resultMatrix parameter in encodeToCommandBuffer is large enough to accommodate the results of this operation, otherwise the results of the encode call are undefined. NOTE: primarySourceMatrixOrigin, secondarySourceMatrixOrigin and resultMatrixOrigin from MPSMatrixBinaryKernel can be used to control the starting points in the primary source, secondary source, and result matrices respectively.
The number of rows to consider from the sources in the operation. This property is modifiable and defaults to NSUIntegerMax and the number is adjusted dynamically at kernel encode time (see encodeToCommandBuffer) to fit into the source matrices available starting from [primary/secondary]SourceMatrixOrigin.x, indicating that by default the whole source matrix is used. If a different size is desired then this should be modified prior to encoding the kernel. It is the user's responsibility to ensure that the resultMatrix parameter in encodeToCommandBuffer is large enough to accommodate the results of this operation, otherwise the results of the encode call are undefined. NOTE: primarySourceMatrixOrigin, secondarySourceMatrixOrigin and resultMatrixOrigin from MPSMatrixBinaryKernel can be used to control the starting points in the primary source, secondary source, and result matrices respectively.
Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.
Mon Jul 9 2018 | Version MetalPerformanceShaders-119.3 |