MPSCNNLossDescriptor(3) | MetalPerformanceShaders.framework | MPSCNNLossDescriptor(3) |
MPSCNNLossDescriptor
#import <MPSCNNLoss.h>
Inherits NSObject, and <NSCopying>.
(nonnull instancetype) - init
(nonnull MPSCNNLossDescriptor *) +
cnnLossDescriptorWithType:reductionType:
MPSCNNLossType lossType
MPSCNNReductionType reductionType
float weight
float labelSmoothing
NSUInteger numberOfClasses
float epsilon
float delta
This depends on Metal.framework. The MPSCNNLossDescriptor specifies a loss filter descriptor. The same descriptor can be used to initialize both the MPSCNNLoss and the MPSCNNLossGradient filters.
Make a descriptor for a MPSCNNLoss or MPSCNNLossGradient object.
Parameters:
Returns:
The delta parameter. The default value is 1.0f. This parameter is valid only for the loss functions of the following type(s): MPSCNNLossTypeHuber.
Given predictions and labels (ground truth), it is applied in the following way: if (|predictions - labels| <= delta, loss = 0.5f * predictions^2 if (|predictions - labels| > delta, loss = 0.5 * delta^2 + delta * (|predictions - labels| - delta)
The epsilon parameter. The default value is 1e-7. This parameter is valid only for the loss functions of the following type(s): MPSCNNLossTypeLog.
Given predictions and labels (ground truth), it is applied in the following way: -(labels * log(predictions + epsilon)) - ((1 - labels) * log(1 - predictions + epsilon))
The label smoothing parameter. The default value is 0.0f. This parameter is valid only for the loss functions of the following type(s): MPSCNNLossFunctionTypeSoftmaxCrossEntropy, MPSCNNLossFunctionTypeSigmoidCrossEntropy.
MPSCNNLossFunctionTypeSoftmaxCrossEntropy: given labels (ground truth), it is applied in the following way: labels = labelSmoothing > 0 ? labels * (1 - labelSmoothing) + labelSmoothing / numberOfClasses : labels
MPSCNNLossFunctionTypeSigmoidCrossEntropy: given labels (ground truth), it is applied in the following way: labels = labelSmoothing > 0 ? labels * (1 - labelSmoothing) + 0.5 * labelSmoothing : labels
The type of a loss filter. This parameter specifies the type of a loss filter.
The number of classes parameter. The default value is 1. This parameter is valid only for the loss functions of the following type(s): MPSCNNLossFunctionTypeSoftmaxCrossEntropy.
Given labels (ground truth), it is applied in the following way: labels = labelSmoothing > 0 ? labels * (1 - labelSmoothing) + labelSmoothing / numberOfClasses : labels
The type of a reduction operation performed in the loss filter. This parameter specifies the type of a reduction operation performed in the loss filter.
The scale factor to apply to each element of a result. Each element of a result is multiplied by the weight value. The default value is 1.0f.
Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.
Mon Jul 9 2018 | Version MetalPerformanceShaders-119.3 |