public class MPSCNNLossLabels extends MPSState
The MPSCNNLossLabels is used to hold the per-element weights buffer used by both MPSCNNLoss forward filter and MPSNNLossGradient backward filter. The MPSCNNLoss forward filter populates the MPSCNNLossLabels object and the MPSNNLossGradient backward filter consumes the state object.
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
MPSCNNLossLabels(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
static MPSCNNLossLabels |
alloc() |
static MPSCNNLossLabels |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
static long |
hash_static() |
MPSCNNLossLabels |
init() |
MPSCNNLossLabels |
initWithDeviceBufferSize(MTLDevice device,
long bufferSize) |
MPSCNNLossLabels |
initWithDeviceLabelsDescriptor(MTLDevice device,
MPSCNNLossDataDescriptor labelsDescriptor)
Set labels (aka targets, ground truth) for the MPSCNNLossLabels object.
|
MPSCNNLossLabels |
initWithDeviceLossImageSizeLabelsDescriptorWeightsDescriptor(MTLDevice device,
MTLSize lossImageSize,
MPSCNNLossDataDescriptor labelsDescriptor,
MPSCNNLossDataDescriptor weightsDescriptor)
Set labels (aka targets, ground truth) and weights for the MPSCNNLossLabels object.
|
MPSCNNLossLabels |
initWithDeviceLossImageSizeLabelsImageWeightsImage(MTLDevice device,
MTLSize lossImageSize,
MPSImage labelsImage,
MPSImage weightsImage)
Set labels (aka targets, ground truth) and weights for the MPSCNNLossLabels object.
|
MPSCNNLossLabels |
initWithDeviceResourceList(MTLDevice device,
MPSStateResourceList resourceList)
Initialize a non-temporary state to hold a number of textures and buffers
|
MPSCNNLossLabels |
initWithDeviceTextureDescriptor(MTLDevice device,
MTLTextureDescriptor descriptor) |
MPSCNNLossLabels |
initWithResource(MTLResource resource)
Create a MPSState with a non-temporary MTLResource
|
MPSCNNLossLabels |
initWithResources(NSArray<?> resources)
Create a state object with a list of MTLResources
|
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
MPSImage |
labelsImage()
Labels image accessor method.
|
MPSImage |
lossImage()
Loss image accessor method.
|
static MPSCNNLossLabels |
new_objc() |
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
static void |
setVersion_static(long aVersion) |
static org.moe.natj.objc.Class |
superclass_static() |
static MPSCNNLossLabels |
temporaryStateWithCommandBuffer(MTLCommandBuffer cmdBuf) |
static MPSCNNLossLabels |
temporaryStateWithCommandBufferBufferSize(MTLCommandBuffer cmdBuf,
long bufferSize) |
static MPSCNNLossLabels |
temporaryStateWithCommandBufferResourceList(MTLCommandBuffer commandBuffer,
MPSStateResourceList resourceList) |
static MPSCNNLossLabels |
temporaryStateWithCommandBufferTextureDescriptor(MTLCommandBuffer cmdBuf,
MTLTextureDescriptor descriptor) |
static long |
version_static() |
MPSImage |
weightsImage()
Weights image accessor method.
|
bufferSizeAtIndex, destinationImageDescriptorForSourceImagesSourceStatesForKernelSuggestedDescriptor, isTemporary, label, readCount, resource, resourceAtIndexAllocateMemory, resourceCount, resourceSize, resourceTypeAtIndex, setLabel, setReadCount, synchronizeOnCommandBuffer, textureInfoAtIndexaccessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public static MPSCNNLossLabels alloc()
public static MPSCNNLossLabels allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public static long hash_static()
public MPSCNNLossLabels init()
public MPSCNNLossLabels initWithDeviceBufferSize(MTLDevice device, long bufferSize)
initWithDeviceBufferSize in class MPSStatepublic MPSCNNLossLabels initWithDeviceLabelsDescriptor(MTLDevice device, MPSCNNLossDataDescriptor labelsDescriptor)
The labels and weights data are copied into internal storage. The computed loss can either be a scalar value (in batch mode, a single value per image in a batch) or it can be one value per feature channel. Thus, the size of the loss image must either match the size of the input source image or be {1, 1, 1}, which results in a scalar value. In this convinience initializer, the assumed size of the loss image is {1, 1, 1}.
device - Device the state resources will be created on.labelsDescriptor - Describes the labels data. This includes:
- The per-element labels data. The data must be in floating point format.
- Data layout of labels data. See MPSImage.h for more information.
- Size of labels data: (width, height, feature channels}.
- Optionally, row bytes of labels data.
- Optionally, slice bytes of labels data.public MPSCNNLossLabels initWithDeviceLossImageSizeLabelsDescriptorWeightsDescriptor(MTLDevice device, MTLSize lossImageSize, MPSCNNLossDataDescriptor labelsDescriptor, MPSCNNLossDataDescriptor weightsDescriptor)
The labels and weights data are copied into internal storage.
device - Device the state resources will be created on.lossImageSize - The size of the resulting loss image: { width, height, featureChannels }.
The computed loss can either be a scalar value (in batch mode, a single
value per image in a batch) or it can be one value per feature channel.
Thus, the size of the loss image must either match the size of the input
source image or be {1, 1, 1}, which results in a scalar value.labelsDescriptor - Describes the labels data. This includes:
- The per-element labels data. The data must be in floating point format.
- Data layout of labels data. See MPSImage.h for more information.
- Size of labels data: (width, height, feature channels}.
- Optionally, row bytes of labels data.
- Optionally, slice bytes of labels data.weightsDescriptor - Describes the weights data. This includes:
- The per-element weights data. The data must be in floating point format.
- Data layout of weights data. See MPSImage.h for more information.
- Size of weights data: (width, height, feature channels}.
- Optionally, row bytes of weights data.
- Optionally, slice bytes of weights data.
This parameter is optional. If you are using a single weight, please use the
weight property of the MPSCNNLossDescriptor object.public MPSCNNLossLabels initWithDeviceLossImageSizeLabelsImageWeightsImage(MTLDevice device, MTLSize lossImageSize, MPSImage labelsImage, MPSImage weightsImage)
The labels and weights images are retained - it is the users responsibility to make sure that they contain the right data when the loss filter is run on the device.
device - Device the state resources will be created on.lossImageSize - The size of the resulting loss image: { width, height, featureChannels }.
The computed loss can either be a scalar value (in batch mode, a single
value per image in a batch) or it can be one value per feature channel.
Thus, the size of the loss image must either match the size of the input
source image or be {1, 1, 1}, which results in a scalar value.labelsImage - Describes the labels data.weightsImage - Describes the weights data.
This parameter is optional. If you are using a single weight, please use the
weight property of the MPSCNNLossDescriptor object.public MPSCNNLossLabels initWithDeviceResourceList(MTLDevice device, MPSStateResourceList resourceList)
MPSStateThe allocation of each resource will be deferred until it is needed. This occurs when -resource or -resourceAtIndex: is called.
initWithDeviceResourceList in class MPSStateresourceList - The list of resources to create.public MPSCNNLossLabels initWithDeviceTextureDescriptor(MTLDevice device, MTLTextureDescriptor descriptor)
initWithDeviceTextureDescriptor in class MPSStatepublic MPSCNNLossLabels initWithResource(MTLResource resource)
MPSStateinitWithResource in class MPSStateresource - A MTLBuffer or MTLTexture. May be nil.public MPSCNNLossLabels initWithResources(NSArray<?> resources)
MPSStateBecause MPS prefers deferred allocation of resources your application should use -initWithTextures:bufferSizes:bufferCount: whenever possible. This method is useful for cases when the MTLResources must be initialized by the CPU.
initWithResources in class MPSStatepublic static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public MPSImage labelsImage()
In order to guarantee that the image is correctly synchronized for CPU side access, it is the application's responsibility to call the [gradientState synchronizeOnCommandBuffer:] method before accessing the data in the image.
public MPSImage lossImage()
In order to guarantee that the image is correctly synchronized for CPU side access, it is the application's responsibility to call the [gradientState synchronizeOnCommandBuffer:] method before accessing the data in the image.
public static MPSCNNLossLabels new_objc()
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static MPSCNNLossLabels temporaryStateWithCommandBuffer(MTLCommandBuffer cmdBuf)
public static MPSCNNLossLabels temporaryStateWithCommandBufferBufferSize(MTLCommandBuffer cmdBuf, long bufferSize)
public static MPSCNNLossLabels temporaryStateWithCommandBufferResourceList(MTLCommandBuffer commandBuffer, MPSStateResourceList resourceList)
public static MPSCNNLossLabels temporaryStateWithCommandBufferTextureDescriptor(MTLCommandBuffer cmdBuf, MTLTextureDescriptor descriptor)
public static long version_static()
public MPSImage weightsImage()
In order to guarantee that the image is correctly synchronized for CPU side access, it is the application's responsibility to call the [gradientState synchronizeOnCommandBuffer:] method before accessing the data in the image.