Class MPSNNLossGradient

All Implemented Interfaces:
NSCoding, NSObjectProtocol, NSSecureCoding, ObjCProtocol

public class MPSNNLossGradient
extends MPSCNNBinaryKernel
Since:
Available in iOS 13.0 and later.
  • Constructor Details

    • MPSNNLossGradient

      public MPSNNLossGradient()
    • MPSNNLossGradient

      protected MPSNNLossGradient​(NSObject.Handle h, long handle)
    • MPSNNLossGradient

      protected MPSNNLossGradient​(NSObject.SkipInit skipInit)
    • MPSNNLossGradient

      public MPSNNLossGradient​(MTLDevice device, MPSCNNLossDescriptor lossDescriptor)
    • MPSNNLossGradient

      public MPSNNLossGradient​(NSCoder decoder, MTLDevice device)
    • MPSNNLossGradient

      public MPSNNLossGradient​(NSCoder coder)
  • Method Details

    • getLossType

      public MPSCNNLossType getLossType()
    • getReductionType

      public MPSCNNReductionType getReductionType()
    • isReduceAcrossBatch

      public boolean isReduceAcrossBatch()
      Since:
      Available in iOS 14.0 and later.
    • getNumberOfClasses

      public long getNumberOfClasses()
    • getWeight

      public float getWeight()
    • setWeight

      public void setWeight​(float v)
    • getLabelSmoothing

      public float getLabelSmoothing()
    • setLabelSmoothing

      public void setLabelSmoothing​(float v)
    • getEpsilon

      public float getEpsilon()
    • setEpsilon

      public void setEpsilon​(float v)
    • getDelta

      public float getDelta()
    • setDelta

      public void setDelta​(float v)
    • isComputeLabelGradients

      public boolean isComputeLabelGradients()
    • setComputeLabelGradients

      public void setComputeLabelGradients​(boolean v)
    • supportsSecureCoding

      public static boolean supportsSecureCoding()
    • init

      protected long init​(MTLDevice device, MPSCNNLossDescriptor lossDescriptor)
    • init

      protected long init​(NSCoder decoder, MTLDevice device)
      Overrides:
      init in class MPSCNNBinaryKernel
    • encodeBatch

      public NSArray<MPSImage> encodeBatch​(MTLCommandBuffer commandBuffer, NSArray<MPSImage> sourceGradients, NSArray<MPSImage> sourceImages, NSArray<MPSImage> labels, NSArray<MPSImage> weights, NSArray<? extends MPSState> sourceStates)
    • encodeBatch

      public void encodeBatch​(MTLCommandBuffer commandBuffer, NSArray<MPSImage> sourceGradients, NSArray<MPSImage> sourceImages, NSArray<MPSImage> labels, NSArray<MPSImage> weights, NSArray<? extends MPSState> sourceStates, NSArray<MPSImage> destinationGradients)