public class MPSRNNMatrixTrainingLayer extends MPSKernel
The MPSRNNMatrixTrainingLayer specifies a recurrent neural network layer for training on MPSMatrices.
A MPSRNNMatrixTrainingLayer is initialized using a @ref MPSRNNLayerDescriptor, which further specifies the recurrent network layer. The input and output vectors in encode calls are stored as rows of the input and output matrices and MPSRNNMatrixTrainingLayer supports matrices with decreasing number of rows: The row-indices identify the different sequences that may be of different lengths - for example if we have three sequences: ( x1, x2, x3 ), ( y1, y2, y3, y4 ) and ( z1, z2 ) of vectors xi, yi and zi, then these can be inserted together as a batch to the sequence encoding kernel by using the matrices: [@code] ( y1 ) ( y2 ) ( y3 ) ( y4 ) m1 = ( x1 ), m2 = ( x2 ), m3 = ( x3 ), m4 = ( z1 ) ( z2 ) [@endcode] The gradient computation pass is then achieved by passing the corresponding gradient sequence from the previous layer ( dx1, dx2, dx3 ), ( dy1, dy2, dy3, dy4 ) and ( dz1, dz2 ) as matrices [@code] ( dy1 ) ( dy2 ) ( dy3 ) ( dy4 ) dm1 = ( dx1 ), dm2 = ( dx2 ), dm3 = ( dx3 ), dm4 = ( dz1 ) ( dz2 ) [@endcode]
The mathematical operation described in the linear transformations of @ref MPSRNNSingleGateDescriptor [@ref] MPSLSTMDescriptor and @ref MPSGRUDescriptor are y^T = W x^T <=> y = x W^T, where x is the matrix containing the input vectors as rows, y is the matrix containing the output vectors as rows and W is the weight matrix.
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
MPSRNNMatrixTrainingLayer(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() |
boolean |
accumulateWeightGradients()
[@property] accumulateWeightGradients
|
static MPSRNNMatrixTrainingLayer |
alloc() |
static MPSRNNMatrixTrainingLayer |
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() |
MPSRNNMatrixTrainingLayer |
copyWithZoneDevice(org.moe.natj.general.ptr.VoidPtr zone,
MTLDevice device)
Make a copy of this kernel for a new device - @see MPSKernel
|
void |
createTemporaryWeightGradientMatricesDataTypeCommandBuffer(NSMutableArray<MPSMatrix> matricesOut,
int dataType,
MTLCommandBuffer commandBuffer)
As @ref createWeightGradientMatrices, but the matrices will be temporary with readCount = 1, which means that they
become invalid after the first encode call that reads them.
|
void |
createWeightGradientMatricesDataType(NSMutableArray<MPSMatrix> matricesOut,
int dataType)
Initializes a set of matrices that can be used in training for weight and bias gradient outputs in
|
void |
createWeightMatrices(NSMutableArray<MPSMatrix> matricesOut)
Initializes a set of matrices that can be used in training for weight and bias matrices in
the forward and backward passes.
|
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
void |
encodeCopyWeightsToCommandBufferWeightsMatrixIdMatrixCopyFromWeightsToMatrixMatrixOffset(MTLCommandBuffer commandBuffer,
NSArray<? extends MPSMatrix> weights,
long matrixId,
MPSMatrix matrix,
boolean copyFromWeightsToMatrix,
MTLOrigin matrixOffset)
Encode a copy kernel that copies one matrix from the trainable weight set to a matrix with standard layout,
where the column index is the input feature channel index (in forward direction) and row index is the output
feature channel index.
|
void |
encodeForwardSequenceToCommandBufferSourceMatricesDestinationMatricesTrainingStatesWeights(MTLCommandBuffer commandBuffer,
NSArray<? extends MPSMatrix> sourceMatrices,
NSArray<? extends MPSMatrix> destinationMatrices,
NSMutableArray<MPSRNNMatrixTrainingState> trainingStates,
NSArray<? extends MPSMatrix> weights)
Encode an MPSRNNMatrixTrainingLayer forward pass kernel for a sequence of inputs into a command buffer.
|
void |
encodeForwardSequenceToCommandBufferSourceMatricesSourceOffsetsDestinationMatricesDestinationOffsetsTrainingStatesRecurrentInputStateRecurrentOutputStatesWeights(MTLCommandBuffer commandBuffer,
NSArray<? extends MPSMatrix> sourceMatrices,
org.moe.natj.general.ptr.NUIntPtr sourceOffsets,
NSArray<? extends MPSMatrix> destinationMatrices,
org.moe.natj.general.ptr.NUIntPtr destinationOffsets,
NSMutableArray<MPSRNNMatrixTrainingState> trainingStates,
MPSRNNRecurrentMatrixState recurrentInputState,
NSMutableArray<MPSRNNRecurrentMatrixState> recurrentOutputStates,
NSArray<? extends MPSMatrix> weights)
Encode an MPSRNNMatrixTrainingLayer forward pass kernel for a sequence of inputs into a command buffer.
|
void |
encodeGradientSequenceToCommandBufferForwardSourcesForwardSourceOffsetsSourceGradientsSourceGradientOffsetsDestinationGradientsDestinationOffsetsWeightGradientsTrainingStatesRecurrentInputStateRecurrentOutputStatesWeights(MTLCommandBuffer commandBuffer,
NSArray<? extends MPSMatrix> forwardSources,
org.moe.natj.general.ptr.NUIntPtr forwardSourceOffsets,
NSArray<? extends MPSMatrix> sourceGradients,
org.moe.natj.general.ptr.NUIntPtr sourceGradientOffsets,
NSArray<? extends MPSMatrix> destinationGradients,
org.moe.natj.general.ptr.NUIntPtr destinationOffsets,
NSArray<? extends MPSMatrix> weightGradients,
NSArray<? extends MPSRNNMatrixTrainingState> trainingStates,
MPSRNNRecurrentMatrixState recurrentInputState,
NSMutableArray<MPSRNNRecurrentMatrixState> recurrentOutputStates,
NSArray<? extends MPSMatrix> weights)
Encode an MPSRNNMatrixTrainingLayer gradient pass kernel for a sequence of input gradients into a command buffer.
|
void |
encodeGradientSequenceToCommandBufferForwardSourcesSourceGradientsDestinationGradientsWeightGradientsTrainingStatesWeights(MTLCommandBuffer commandBuffer,
NSArray<? extends MPSMatrix> forwardSources,
NSArray<? extends MPSMatrix> sourceGradients,
NSArray<? extends MPSMatrix> destinationGradients,
NSArray<? extends MPSMatrix> weightGradients,
NSArray<? extends MPSRNNMatrixTrainingState> trainingStates,
NSArray<? extends MPSMatrix> weights)
Encode an MPSRNNMatrixTrainingLayer gradient pass kernel for a sequence of input gradients into a command buffer.
|
static long |
hash_static() |
MPSRNNMatrixTrainingLayer |
init() |
MPSRNNMatrixTrainingLayer |
initWithCoder(NSCoder aDecoder)
NS_DESIGNATED_INITIALIZER
|
MPSRNNMatrixTrainingLayer |
initWithCoderDevice(NSCoder aDecoder,
java.lang.Object device)
NSSecureCoding compatability
|
MPSRNNMatrixTrainingLayer |
initWithDevice(java.lang.Object device)
Standard init with default properties per filter type
|
MPSRNNMatrixTrainingLayer |
initWithDeviceRnnDescriptorTrainableWeights(MTLDevice device,
MPSRNNDescriptor rnnDescriptor,
NSMutableArray<MPSMatrix> trainableWeights)
Initializes a linear (fully connected) RNN kernel for training
|
long |
inputFeatureChannels()
[@property] inputFeatureChannels
|
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 MPSRNNMatrixTrainingLayer |
new_objc() |
long |
outputFeatureChannels()
[@property] outputFeatureChannels
|
boolean |
recurrentOutputIsTemporary()
[@property] recurrentOutputIsTemporary
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
void |
setAccumulateWeightGradients(boolean value)
[@property] accumulateWeightGradients
|
void |
setRecurrentOutputIsTemporary(boolean value)
[@property] recurrentOutputIsTemporary
|
void |
setStoreAllIntermediateStates(boolean value)
[@property] storeAllIntermediateStates
|
void |
setTrainingStateIsTemporary(boolean value)
[@property] trainingStateIsTemporary
|
static void |
setVersion_static(long aVersion) |
boolean |
storeAllIntermediateStates()
[@property] storeAllIntermediateStates
|
static org.moe.natj.objc.Class |
superclass_static() |
static boolean |
supportsSecureCoding() |
boolean |
trainingStateIsTemporary()
[@property] trainingStateIsTemporary
|
static long |
version_static() |
copyWithZone, 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 MPSRNNMatrixTrainingLayer(org.moe.natj.general.Pointer peer)
public static boolean accessInstanceVariablesDirectly()
public boolean accumulateWeightGradients()
If yes then the computed weight gradients are accumulated on top of existing values in calls to the gradient computation functions: encodeGradientSequenceToCommandBuffer. Defaults to NO.
public static MPSRNNMatrixTrainingLayer alloc()
public static MPSRNNMatrixTrainingLayer 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 MPSRNNMatrixTrainingLayer 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 void createTemporaryWeightGradientMatricesDataTypeCommandBuffer(NSMutableArray<MPSMatrix> matricesOut, int dataType, MTLCommandBuffer commandBuffer)
matricesOut - An array where the newly created matrices will be stored, will be initialized to zero.dataType - Datatype for the entries - currently MPSDataTypeFloat32 and MPSDataTypeFloat16 are supported.commandBuffer - The command buffer that the temporary matrices will live on.public void createWeightGradientMatricesDataType(NSMutableArray<MPSMatrix> matricesOut, int dataType)
matricesOut - An array where the newly created matrices will be stored, will be initialized to zero.dataType - Datatype for the entries - currently MPSDataTypeFloat32 and MPSDataTypeFloat16 are supported.Can be also used to easily create auxiliary matrices for example
for ADAM and other advanced optimization schemes. The layout and number of matrices is the same as for the outputs of,
initWithDevice, but the data type may differ. NOTE: These matrices cannot be used as weight matrices in the
forward and backward encode calls, but matrices from initWithDevice() or createWeightMatrices() should be used instead.public void createWeightMatrices(NSMutableArray<MPSMatrix> matricesOut)
matricesOut - An array where the newly created matrices will be stored, will be initialized to zero.initWithDevice.public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public void encodeCopyWeightsToCommandBufferWeightsMatrixIdMatrixCopyFromWeightsToMatrixMatrixOffset(MTLCommandBuffer commandBuffer, NSArray<? extends MPSMatrix> weights, long matrixId, MPSMatrix matrix, boolean copyFromWeightsToMatrix, MTLOrigin matrixOffset)
commandBuffer - A valid MTLCommandBuffer to receive the encoded filterweights - An array weights from @see initWithDevice or @see createWeightMatrices.matrixId - Which matrix to copy - has to be a valid Id based on inputs defined in
the rnnDescriptor of @see initWithDevice.matrix - The destination or source matrix that is used in the copy.copyFromWeightsToMatrix - If YES then the copy direction is from the set of trainable 'weights' to 'matrix',
otherwise the copy is done from 'matrix' to 'weights'.matrixOffset - A (valid) offset into matrix to be applied to the copy operation.public void encodeForwardSequenceToCommandBufferSourceMatricesDestinationMatricesTrainingStatesWeights(MTLCommandBuffer commandBuffer, NSArray<? extends MPSMatrix> sourceMatrices, NSArray<? extends MPSMatrix> destinationMatrices, NSMutableArray<MPSRNNMatrixTrainingState> trainingStates, NSArray<? extends MPSMatrix> weights)
commandBuffer - A valid MTLCommandBuffer to receive the encoded filtersourceMatrices - An array of valid MPSMatrix objects containing the sequence of source matrices.destinationMatrices - An array valid MPSMatrices to be overwritten by result matrix sequence.
destinationMatrices may not alias sourceMatrices.trainingStates - An array containing the training states to be passed to the gradient computation
encode function.weights - An array of valid MPSMatrix objects containing the weights, should be the array
that was produced either by @see initWithDevice or @see createWeightMatrices.public void encodeForwardSequenceToCommandBufferSourceMatricesSourceOffsetsDestinationMatricesDestinationOffsetsTrainingStatesRecurrentInputStateRecurrentOutputStatesWeights(MTLCommandBuffer commandBuffer, NSArray<? extends MPSMatrix> sourceMatrices, org.moe.natj.general.ptr.NUIntPtr sourceOffsets, NSArray<? extends MPSMatrix> destinationMatrices, org.moe.natj.general.ptr.NUIntPtr destinationOffsets, NSMutableArray<MPSRNNMatrixTrainingState> trainingStates, MPSRNNRecurrentMatrixState recurrentInputState, NSMutableArray<MPSRNNRecurrentMatrixState> recurrentOutputStates, NSArray<? extends MPSMatrix> weights)
commandBuffer - A valid MTLCommandBuffer to receive the encoded filtersourceMatrices - An array of valid MPSMatrix objects containing the sequence of source matrices.sourceOffsets - An array of byte-offsets into the sourceMatrices, if nil zeros are assumed and
if not nil must contain offset for every matrix in sourceMatrices.destinationMatrices - An array valid MPSMatrices to be overwritten by result matrix sequence.
destinationMatrices may not alias sourceMatrices.destinationOffsets - An array of byte-offsets into the destinationMatrices, if nil zeros are assumed and
if not nil must contain offset for every matrix in destinationMatrices.trainingStates - An array containing the training states to be passed to the gradient computation
encode function.recurrentInputState - An optional state containing the output matrices and memory cells (for LSTMs)
of the layer obtained from the previous input matrices in a sequence of inputs.
Has to be the output of a previous call to this function or nil (assumed zero).recurrentOutputStates - An array that will be appended with the recurrent output states. May not be nil.
If recurrentOutputIsTemporary is YES and then all returned recurrent states
will be temporary. @see MPSState:isTemporary.weights - An array of valid MPSMatrix objects containing the weights, should be the array
that was produced either by @see initWithDevice or @see createWeightMatrices.public void encodeGradientSequenceToCommandBufferForwardSourcesForwardSourceOffsetsSourceGradientsSourceGradientOffsetsDestinationGradientsDestinationOffsetsWeightGradientsTrainingStatesRecurrentInputStateRecurrentOutputStatesWeights(MTLCommandBuffer commandBuffer, NSArray<? extends MPSMatrix> forwardSources, org.moe.natj.general.ptr.NUIntPtr forwardSourceOffsets, NSArray<? extends MPSMatrix> sourceGradients, org.moe.natj.general.ptr.NUIntPtr sourceGradientOffsets, NSArray<? extends MPSMatrix> destinationGradients, org.moe.natj.general.ptr.NUIntPtr destinationOffsets, NSArray<? extends MPSMatrix> weightGradients, NSArray<? extends MPSRNNMatrixTrainingState> trainingStates, MPSRNNRecurrentMatrixState recurrentInputState, NSMutableArray<MPSRNNRecurrentMatrixState> recurrentOutputStates, NSArray<? extends MPSMatrix> weights)
commandBuffer - A valid MTLCommandBuffer to receive the encoded filterforwardSources - An array of MPSMatrix objects containing the sequence of source matrices of the forward pass.forwardSourceOffsets - An array of byte-offsets into the forwardSources, if nil zeros are assumed and
if not nil must contain offset for every matrix in forwardSources.sourceGradients - An array of valid MPSMatrix objects containing the sequence of source gradient matrices.sourceGradientOffsets - An array of byte-offsets into the sourceGradients, if nil zeros are assumed and
if not nil must contain offset for every matrix in sourceGradients.destinationGradients - An array valid MPSMatrix objects that will receive the backpropagated gradients, may be
nil if not needed (for example first layer in graph).destinationOffsets - An array of byte-offsets into the destinationGradients, if nil zeros are assumed and
if not nil must contain offset for every matrix in destinationGradients.weightGradients - An array of valid MPSMatrix objects that will receive the gradient wrt. weights and
biases of the layer - should be the array that was produced either
by @see initWithDevice or @see createWeightMatrices. May be nil in which case
the gradients for the weights are not computed.trainingStates - An array containing the training states from the forward pass - the array must contain
the states corresponding to the input gradients is sourceGradients.recurrentInputState - An optional state containing the output matrices and memory cells (for LSTMs)
of the layer obtained from the previous input gradients in a sequence of inputs.
Has to be the output of a previous call to this function or nil (assumed zero).recurrentOutputStates - An array that will be appended with the recurrent output states. Can be nil.
If recurrentOutputIsTemporary is YES and then all returned recurrent states
will be temporary. @see MPSState:isTemporary.weights - An array of valid MPSMatrix objects containing the weights, should be the array
that was produced either by @see initWithDevice or @see createWeightMatrices.public void encodeGradientSequenceToCommandBufferForwardSourcesSourceGradientsDestinationGradientsWeightGradientsTrainingStatesWeights(MTLCommandBuffer commandBuffer, NSArray<? extends MPSMatrix> forwardSources, NSArray<? extends MPSMatrix> sourceGradients, NSArray<? extends MPSMatrix> destinationGradients, NSArray<? extends MPSMatrix> weightGradients, NSArray<? extends MPSRNNMatrixTrainingState> trainingStates, NSArray<? extends MPSMatrix> weights)
commandBuffer - A valid MTLCommandBuffer to receive the encoded filterforwardSources - An array of MPSMatrix objects containing the sequence of source matrices of the forward pass.sourceGradients - An array of MPSMatrix objects containing the sequence of source gradient matrices.destinationGradients - An array valid MPSMatrix objects that will receive the backpropagated gradients, may be
nil if not needed (for example first layer in graph).weightGradients - An array valid MPSMatrix objects that will receive the gradient wrt. weights and
biases of the layer - should be the array that was produced either
by @see initWithDevice or @see createWeightMatrices. May be nil in which case
the gradients for the weights are not computed.
NOTE: The weight gradients are accumulated on top of existing values sotrainingStates - An array containing the training states from the forward pass - the array must contain
the states corresponding to the input gradients is sourceGradients.weights - An array of valid MPSMatrix objects containing the weights, should be the array
that was produced either by @see initWithDevice or @see createWeightMatrices.public static long hash_static()
public MPSRNNMatrixTrainingLayer init()
public MPSRNNMatrixTrainingLayer initWithCoder(NSCoder aDecoder)
NSCodinginitWithCoder in interface NSCodinginitWithCoder in class MPSKernelpublic MPSRNNMatrixTrainingLayer initWithCoderDevice(NSCoder aDecoder, java.lang.Object device)
See @ref MPSKernel#initWithCoder.
initWithCoderDevice in class MPSKernelaDecoder - The NSCoder subclass with your serialized MPSRNNMatrixTrainingLayerdevice - The MTLDevice on which to make the MPSRNNMatrixTrainingLayerpublic MPSRNNMatrixTrainingLayer initWithDevice(java.lang.Object device)
MPSKernelinitWithDevice in class MPSKerneldevice - The device that the filter will be used on. May not be NULL.public MPSRNNMatrixTrainingLayer initWithDeviceRnnDescriptorTrainableWeights(MTLDevice device, MPSRNNDescriptor rnnDescriptor, NSMutableArray<MPSMatrix> trainableWeights)
device - The MTLDevice on which this MPSRNNMatrixLayer filter will be usedrnnDescriptor - The descriptor that defines the RNN layertrainableWeights - An array where to store the weights of the layer as MPSMatrices.
NOTE: The exact layout and number of matrices may vary between
platforms and therefore you should not save out these weights directly,
but instead use the function encodeCopyWeightsToCommandBuffer to identify
the weights and biases for serialization.
Typically you should pass here an initialized but empty NSMutableArray and
when this function returns the array will have been populated with the
weight matrices needed in the encode-calls, by using initial values from
the datasources in rnnDescriptor.public long inputFeatureChannels()
The number of feature channels input vector/matrix.
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 MPSRNNMatrixTrainingLayer new_objc()
public long outputFeatureChannels()
The number of feature channels in the output vector/matrix.
public boolean recurrentOutputIsTemporary()
How recurrent output states from @ref encodeForwardSequenceToCommandBuffer and encodeGradientSequenceToCommandBuffer are constructed. Defaults to NO. For reference @see MPSState.
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public void setAccumulateWeightGradients(boolean value)
If yes then the computed weight gradients are accumulated on top of existing values in calls to the gradient computation functions: encodeGradientSequenceToCommandBuffer. Defaults to NO.
public void setRecurrentOutputIsTemporary(boolean value)
How recurrent output states from @ref encodeForwardSequenceToCommandBuffer and encodeGradientSequenceToCommandBuffer are constructed. Defaults to NO. For reference @see MPSState.
public void setStoreAllIntermediateStates(boolean value)
If YES then calls to functions @ref encodeForwardSequenceToCommandBuffer and [@ref] encodeGradientSequenceToCommandBuffer return every recurrent state in the array: recurrentOutputStates. Defaults to NO.
public void setTrainingStateIsTemporary(boolean value)
How training output states from @ref encodeForwardSequenceToCommandBuffer are constructed. Defaults to NO. For reference @see MPSState.
public static void setVersion_static(long aVersion)
public boolean storeAllIntermediateStates()
If YES then calls to functions @ref encodeForwardSequenceToCommandBuffer and [@ref] encodeGradientSequenceToCommandBuffer return every recurrent state in the array: recurrentOutputStates. Defaults to NO.
public static org.moe.natj.objc.Class superclass_static()
public static boolean supportsSecureCoding()
public boolean _supportsSecureCoding()
NSSecureCoding_supportsSecureCoding in interface NSSecureCoding_supportsSecureCoding in class MPSKernelpublic boolean trainingStateIsTemporary()
How training output states from @ref encodeForwardSequenceToCommandBuffer are constructed. Defaults to NO. For reference @see MPSState.
public static long version_static()