public class MPSMatrixFullyConnectedGradient extends MPSMatrixBinaryKernel
[@dependency] This depends on Metal.framework.
Computes the gradient of the fully connected layer with respect to either the weights and bias terms or the input feature vectors.
An MPSMatrixFullyConnectedGradient kernel may be used to compute the gradients corresponding to a MPSMatrixFullyConnected kernel. The properties, input, and weight data must match those values used in the forward computation. This kernel does not compute the gradient of any non-identity activation function which may have been applied in the forward kernel. Such a kernel must be expressed using both MPSMatrixFullyConnected and MPSMatrixNeuron if a gradient is to be computed.
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
MPSMatrixFullyConnectedGradient(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
_supportsSecureCoding()
This property must return YES on all classes that allow secure coding.
|
static boolean |
accessInstanceVariablesDirectly() |
static MPSMatrixFullyConnectedGradient |
alloc() |
static MPSMatrixFullyConnectedGradient |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
double |
alpha()
[@property] alpha
|
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() |
MPSMatrixFullyConnectedGradient |
copyWithZoneDevice(org.moe.natj.general.ptr.VoidPtr zone,
MTLDevice device)
Make a copy of this kernel for a new device - @see MPSKernel
|
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
void |
encodeGradientForDataToCommandBufferGradientMatrixWeightMatrixResultGradientForDataMatrix(MTLCommandBuffer commandBuffer,
MPSMatrix gradientMatrix,
MPSMatrix weightMatrix,
MPSMatrix resultGradientForDataMatrix)
Encode a MPSMatrixFullyConnectedGradient object to a command buffer and
produce the gradient of the loss function with respect to the input data.
|
void |
encodeGradientForWeightsAndBiasToCommandBufferGradientMatrixInputMatrixResultGradientForWeightMatrixResultGradientForBiasVector(MTLCommandBuffer commandBuffer,
MPSMatrix gradientMatrix,
MPSMatrix inputMatrix,
MPSMatrix resultGradientForWeightMatrix,
MPSVector resultGradientForBiasVector)
Encode a MPSMatrixFullyConnectedGradient object to a command buffer and
produce the gradient of the loss function with respect to the weight matrix
and bias vector.
|
static long |
hash_static() |
MPSMatrixFullyConnectedGradient |
init() |
MPSMatrixFullyConnectedGradient |
initWithCoder(NSCoder aDecoder)
NS_DESIGNATED_INITIALIZER
|
MPSMatrixFullyConnectedGradient |
initWithCoderDevice(NSCoder aDecoder,
java.lang.Object device)
NSSecureCoding compatability
|
MPSMatrixFullyConnectedGradient |
initWithDevice(java.lang.Object device)
Standard init with default properties per filter type
|
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) |
static MPSMatrixFullyConnectedGradient |
new_objc() |
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
void |
setAlpha(double value)
[@property] alpha
|
void |
setSourceInputFeatureChannels(long value)
[@property] sourceInputFeatureChannels
|
void |
setSourceNumberOfFeatureVectors(long value)
[@property] sourceNumberOfFeatureVectors
|
void |
setSourceOutputFeatureChannels(long value)
[@property] sourceOutputFeatureChannels
|
static void |
setVersion_static(long aVersion) |
long |
sourceInputFeatureChannels()
[@property] sourceInputFeatureChannels
|
long |
sourceNumberOfFeatureVectors()
[@property] sourceNumberOfFeatureVectors
|
long |
sourceOutputFeatureChannels()
[@property] sourceOutputFeatureChannels
|
static org.moe.natj.objc.Class |
superclass_static() |
static boolean |
supportsSecureCoding() |
static long |
version_static() |
batchSize, batchStart, primarySourceMatrixOrigin, resultMatrixOrigin, secondarySourceMatrixOrigin, setBatchSize, setBatchStart, setPrimarySourceMatrixOrigin, setResultMatrixOrigin, setSecondarySourceMatrixOrigincopyWithZone, device, encodeWithCoder, label, options, setLabel, setOptionsaccessibilityActivate, 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, willChangeValuesAtIndexesForKeyprotected MPSMatrixFullyConnectedGradient(org.moe.natj.general.Pointer peer)
public static boolean accessInstanceVariablesDirectly()
public static MPSMatrixFullyConnectedGradient alloc()
public static MPSMatrixFullyConnectedGradient allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public double alpha()
Scale factor to apply to the product. This value should be equal to the corresponding value in the forward fully connected kernel.
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 MPSMatrixFullyConnectedGradient copyWithZoneDevice(org.moe.natj.general.ptr.VoidPtr zone, MTLDevice device)
copyWithZoneDevice in class MPSKernelzone - The NSZone in which to allocate the objectdevice - The device for the new MPSKernel. If nil, then use
self.device.public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public void encodeGradientForDataToCommandBufferGradientMatrixWeightMatrixResultGradientForDataMatrix(MTLCommandBuffer commandBuffer, MPSMatrix gradientMatrix, MPSMatrix weightMatrix, MPSMatrix resultGradientForDataMatrix)
This operation computes the resulting gradient of the loss function with respect to the forward kernel's input data. weightMatrix should contain the same values used to compute the result of the forward kernel.
commandBuffer - A valid MTLCommandBuffer to receive the encoded kernel.gradientMatrix - A valid MPSMatrix object which specifies the input gradient.weightMatrix - A valid MPSMatrix object which specifies the weight array.resultGradientForDataMatrix - A valid MPSMatrix object which specifies the result gradient.public void encodeGradientForWeightsAndBiasToCommandBufferGradientMatrixInputMatrixResultGradientForWeightMatrixResultGradientForBiasVector(MTLCommandBuffer commandBuffer, MPSMatrix gradientMatrix, MPSMatrix inputMatrix, MPSMatrix resultGradientForWeightMatrix, MPSVector resultGradientForBiasVector)
This operation computes the resulting gradient of the loss function with respect to the forward kernel's weight data. inputMatrix should contain the same values used to compute the result of the forward kernel.
commandBuffer - A valid MTLCommandBuffer to receive the encoded kernel.gradientMatrix - A valid MPSMatrix object which specifies the input gradient.inputMatrix - A valid MPSMatrix object which specifies the input array.resultGradientForWeightMatrix - A valid MPSMatrix object which specifies the resulting gradients
with respect to the weights.resultGradientForBiasVector - A valid MPSVector object which specifies the resulting gradients
with respect to the bias terms. If NULL these values will not be
returned.public static long hash_static()
public MPSMatrixFullyConnectedGradient init()
init in class MPSMatrixBinaryKernelpublic MPSMatrixFullyConnectedGradient initWithCoder(NSCoder aDecoder)
NSCodinginitWithCoder in interface NSCodinginitWithCoder in class MPSMatrixBinaryKernelpublic MPSMatrixFullyConnectedGradient initWithCoderDevice(NSCoder aDecoder, java.lang.Object device)
See @ref MPSKernel#initWithCoder.
initWithCoderDevice in class MPSMatrixBinaryKernelaDecoder - The NSCoder subclass with your serialized MPSMatrixFullyConnectedGradientdevice - The MTLDevice on which to make the MPSMatrixFullyConnectedGradient object.public MPSMatrixFullyConnectedGradient initWithDevice(java.lang.Object device)
MPSKernelinitWithDevice in class MPSMatrixBinaryKerneldevice - The device that the filter will be used on. May not be NULL.public 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 static MPSMatrixFullyConnectedGradient new_objc()
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public void setAlpha(double value)
Scale factor to apply to the product. This value should be equal to the corresponding value in the forward fully connected kernel.
public void setSourceInputFeatureChannels(long value)
The number of feature channels in the input to the forward fully connected layer. This is equivalent to the number of columns in the input matrix.
This value should be equal to the corresponding value in the forward fully connected kernel.
public void setSourceNumberOfFeatureVectors(long value)
The number of input vectors which make up the input array. This is equivalent to the number of rows in both the input matrix and the source gradient matrix.
This value should be equal to the corresponding value in the forward fully connected kernel.
public void setSourceOutputFeatureChannels(long value)
The number of feature channels in the output of the forward fully connected layer. This is equivalent to the number of columns in both the weight matrix and the source gradient matrix.
This value should be equal to the corresponding value in the forward fully connected kernel.
public static void setVersion_static(long aVersion)
public long sourceInputFeatureChannels()
The number of feature channels in the input to the forward fully connected layer. This is equivalent to the number of columns in the input matrix.
This value should be equal to the corresponding value in the forward fully connected kernel.
public long sourceNumberOfFeatureVectors()
The number of input vectors which make up the input array. This is equivalent to the number of rows in both the input matrix and the source gradient matrix.
This value should be equal to the corresponding value in the forward fully connected kernel.
public long sourceOutputFeatureChannels()
The number of feature channels in the output of the forward fully connected layer. This is equivalent to the number of columns in both the weight matrix and the source gradient matrix.
This value should be equal to the corresponding value in the forward fully connected kernel.
public static org.moe.natj.objc.Class superclass_static()
public static boolean supportsSecureCoding()
public boolean _supportsSecureCoding()
NSSecureCoding_supportsSecureCoding in interface NSSecureCoding_supportsSecureCoding in class MPSMatrixBinaryKernelpublic static long version_static()