Interface MPSNNLossCallback

  • All Superinterfaces:
    NSCoding, NSCopying, NSSecureCoding

    public interface MPSNNLossCallback
    extends NSSecureCoding, NSCopying
    [@protocol] MPSNNLossCallback MPSNNLossCallback Defines a callback protocol for @ref MPSNNForwardLossNode and @ref MPSNNLossGradientNode to set the scalar weight value just before encoding the underlying kernels.
    • Method Detail

      • scalarWeightForSourceImageDestinationImage

        float scalarWeightForSourceImageDestinationImage​(MPSImage sourceImage,
                                                         MPSImage destinationImage)
        Returns the desired loss scaling weight value.
        Parameters:
        sourceImage - One of the source images in the batch given as a reference.
        destinationImage - One of the destination images in the batch given as a reference.
        Returns:
        The desired scalar weight value.