.TH "MPSCNNLossDescriptor" 3 "Mon Jul 9 2018" "Version MetalPerformanceShaders-119.3" "MetalPerformanceShaders.framework" \" -*- nroff -*- .ad l .nh .SH NAME MPSCNNLossDescriptor .SH SYNOPSIS .br .PP .PP \fC#import \fP .PP Inherits NSObject, and \&. .SS "Instance Methods" .in +1c .ti -1c .RI "(nonnull instancetype) \- \fBinit\fP" .br .in -1c .SS "Class Methods" .in +1c .ti -1c .RI "(nonnull \fBMPSCNNLossDescriptor\fP *) + \fBcnnLossDescriptorWithType:reductionType:\fP" .br .in -1c .SS "Properties" .in +1c .ti -1c .RI "\fBMPSCNNLossType\fP \fBlossType\fP" .br .ti -1c .RI "\fBMPSCNNReductionType\fP \fBreductionType\fP" .br .ti -1c .RI "float \fBweight\fP" .br .ti -1c .RI "float \fBlabelSmoothing\fP" .br .ti -1c .RI "NSUInteger \fBnumberOfClasses\fP" .br .ti -1c .RI "float \fBepsilon\fP" .br .ti -1c .RI "float \fBdelta\fP" .br .in -1c .SH "Detailed Description" .PP This depends on Metal\&.framework\&. The \fBMPSCNNLossDescriptor\fP specifies a loss filter descriptor\&. The same descriptor can be used to initialize both the \fBMPSCNNLoss\fP and the MPSCNNLossGradient filters\&. .SH "Method Documentation" .PP .SS "+ (nonnull \fBMPSCNNLossDescriptor\fP*) cnnLossDescriptorWithType: (\fBMPSCNNLossType\fP) lossType(\fBMPSCNNReductionType\fP) reductionType" Make a descriptor for a \fBMPSCNNLoss\fP or MPSCNNLossGradient object\&. .PP \fBParameters:\fP .RS 4 \fIlossType\fP The type of a loss filter\&. .br \fIreductionType\fP The type of a reduction operation to apply\&. This argument is ignored in the MPSCNNLossGradient filter\&. .RE .PP \fBReturns:\fP .RS 4 \fBA\fP valid \fBMPSCNNLossDescriptor\fP object or nil, if failure\&. .RE .PP .SS "\- (nonnull instancetype) init " .SH "Property Documentation" .PP .SS "\- delta\fC [read]\fP, \fC [write]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" The delta parameter\&. The default value is 1\&.0f\&. This parameter is valid only for the loss functions of the following type(s): MPSCNNLossTypeHuber\&. .PP 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) .SS "\- epsilon\fC [read]\fP, \fC [write]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" The epsilon parameter\&. The default value is 1e-7\&. This parameter is valid only for the loss functions of the following type(s): MPSCNNLossTypeLog\&. .PP Given predictions and labels (ground truth), it is applied in the following way: -(labels * log(predictions + epsilon)) - ((1 - labels) * log(1 - predictions + epsilon)) .SS "\- labelSmoothing\fC [read]\fP, \fC [write]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" 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\&. .PP MPSCNNLossFunctionTypeSoftmaxCrossEntropy: given labels (ground truth), it is applied in the following way: labels = labelSmoothing > 0 ? labels * (1 - labelSmoothing) + labelSmoothing / numberOfClasses : labels .PP MPSCNNLossFunctionTypeSigmoidCrossEntropy: given labels (ground truth), it is applied in the following way: labels = labelSmoothing > 0 ? labels * (1 - labelSmoothing) + 0\&.5 * labelSmoothing : labels .SS "\- lossType\fC [read]\fP, \fC [write]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" The type of a loss filter\&. This parameter specifies the type of a loss filter\&. .SS "\- numberOfClasses\fC [read]\fP, \fC [write]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" 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\&. .PP Given labels (ground truth), it is applied in the following way: labels = labelSmoothing > 0 ? labels * (1 - labelSmoothing) + labelSmoothing / numberOfClasses : labels .SS "\- reductionType\fC [read]\fP, \fC [write]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" 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\&. .SS "\- weight\fC [read]\fP, \fC [write]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" 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\&. .SH "Author" .PP Generated automatically by Doxygen for MetalPerformanceShaders\&.framework from the source code\&.