public class MPSNNOptimizerDescriptor extends NSObject
The MPSNNOptimizerDescriptor base class. Optimizers are generally used to update trainable neural network parameters. Users are usually expected to call these MPSKernels from the update methods on their Convolution or BatchNormalization data sources.
Before the gradient is used to update the original value, some preprocessing occurs on each gradient where it is scaled or clipped If regularization is chosen the appropriate regularization loss gradient is added to the value gradient.
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
MPSNNOptimizerDescriptor(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
static MPSNNOptimizerDescriptor |
alloc() |
static MPSNNOptimizerDescriptor |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
boolean |
applyGradientClipping()
[@property] applyGradientClipping
|
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() |
float |
gradientClipMax()
[@property] gradientClipMax
|
float |
gradientClipMin()
[@property] gradientClipMin
|
float |
gradientRescale()
[@property] gradientRescale
|
static long |
hash_static() |
MPSNNOptimizerDescriptor |
init() |
MPSNNOptimizerDescriptor |
initWithLearningRateGradientRescaleApplyGradientClippingGradientClipMaxGradientClipMinRegularizationTypeRegularizationScale(float learningRate,
float gradientRescale,
boolean applyGradientClipping,
float gradientClipMax,
float gradientClipMin,
long regularizationType,
float regularizationScale)
Initialization for the MPSNNOptimizerDescriptor object
|
MPSNNOptimizerDescriptor |
initWithLearningRateGradientRescaleRegularizationTypeRegularizationScale(float learningRate,
float gradientRescale,
long regularizationType,
float regularizationScale)
Initialization for the MPSNNOptimizerDescriptor object, no gradient clipping would be applied
|
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) |
float |
learningRate()
[@property] learningRate
|
static MPSNNOptimizerDescriptor |
new_objc() |
static MPSNNOptimizerDescriptor |
optimizerDescriptorWithLearningRateGradientRescaleApplyGradientClippingGradientClipMaxGradientClipMinRegularizationTypeRegularizationScale(float learningRate,
float gradientRescale,
boolean applyGradientClipping,
float gradientClipMax,
float gradientClipMin,
long regularizationType,
float regularizationScale)
Creates a descriptor on autoreleaspool for the MPSNNOptimizerDescriptor object
|
static MPSNNOptimizerDescriptor |
optimizerDescriptorWithLearningRateGradientRescaleRegularizationTypeRegularizationScale(float learningRate,
float gradientRescale,
long regularizationType,
float regularizationScale)
Creates a descriptor on autoreleaspool for the MPSNNOptimizerDescriptor object, no gradient clipping would be applied
|
float |
regularizationScale()
[@property] regularizationScale
|
long |
regularizationType()
[@property] regularizationType
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
void |
setApplyGradientClipping(boolean value)
[@property] applyGradientClipping
|
void |
setGradientClipMax(float value)
[@property] gradientClipMax
|
void |
setGradientClipMin(float value)
[@property] gradientClipMin
|
void |
setGradientRescale(float value)
[@property] gradientRescale
|
void |
setLearningRate(float value)
[@property] learningRate
|
void |
setRegularizationScale(float value)
[@property] regularizationScale
|
void |
setRegularizationType(long value)
[@property] regularizationType
|
static void |
setVersion_static(long aVersion) |
static org.moe.natj.objc.Class |
superclass_static() |
static long |
version_static() |
accessibilityActivate, 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 MPSNNOptimizerDescriptor(org.moe.natj.general.Pointer peer)
public static boolean accessInstanceVariablesDirectly()
public static MPSNNOptimizerDescriptor alloc()
public static MPSNNOptimizerDescriptor allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public boolean applyGradientClipping()
A bool which decides if gradient will be clipped
The default value is NO
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 float gradientClipMax()
The maximum value at which incoming gradient will be clipped before rescaling, applyGradientClipping must be true
public float gradientClipMin()
The minimum value at which incoming gradient will be clipped before rescaling, applyGradientClipping must be true
public float gradientRescale()
The gradientRescale at which we apply to incoming gradient values
The default value is 1.0
public static long hash_static()
public MPSNNOptimizerDescriptor init()
public MPSNNOptimizerDescriptor initWithLearningRateGradientRescaleApplyGradientClippingGradientClipMaxGradientClipMinRegularizationTypeRegularizationScale(float learningRate, float gradientRescale, boolean applyGradientClipping, float gradientClipMax, float gradientClipMin, long regularizationType, float regularizationScale)
learningRate - The learningRate which will be appliedgradientRescale - The gradientRescale which will be appliedapplyGradientClipping - The BOOL which sets if gradientClipping would be applied to the gradientgradientClipMax - The gradientClipMax which will be appliedgradientClipMin - The gradientClipMin which will be appliedregularizationType - The regularizationType which will be appliedregularizationScale - The regularizationScale which will be appliedpublic MPSNNOptimizerDescriptor initWithLearningRateGradientRescaleRegularizationTypeRegularizationScale(float learningRate, float gradientRescale, long regularizationType, float regularizationScale)
learningRate - The learningRate which will be appliedgradientRescale - The gradientRescale which will be appliedregularizationType - The regularizationType which will be appliedregularizationScale - The regularizationScale which will be appliedpublic 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 float learningRate()
The learningRate at which we update values
The default value is 0.001f
public static MPSNNOptimizerDescriptor new_objc()
public static MPSNNOptimizerDescriptor optimizerDescriptorWithLearningRateGradientRescaleApplyGradientClippingGradientClipMaxGradientClipMinRegularizationTypeRegularizationScale(float learningRate, float gradientRescale, boolean applyGradientClipping, float gradientClipMax, float gradientClipMin, long regularizationType, float regularizationScale)
learningRate - The learningRate which will be appliedgradientRescale - The gradientRescale which will be appliedapplyGradientClipping - The BOOL which sets if gradientClipping would be applied to the gradientgradientClipMax - The gradientClipMax which will be appliedgradientClipMin - The gradientClipMin which will be appliedregularizationType - The regularizationType which will be appliedregularizationScale - The regularizationScale which will be appliedpublic static MPSNNOptimizerDescriptor optimizerDescriptorWithLearningRateGradientRescaleRegularizationTypeRegularizationScale(float learningRate, float gradientRescale, long regularizationType, float regularizationScale)
learningRate - The learningRate which will be appliedgradientRescale - The gradientRescale which will be appliedregularizationType - The regularizationType which will be appliedregularizationScale - The regularizationScale which will be appliedpublic float regularizationScale()
The regularizationScale at which we apply L1 or L2 regularization, it gets ignored if regularization is None
The default value is 0.0
public long regularizationType()
The regularizationType which we apply.
The default value is MPSRegularizationTypeNone
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public void setApplyGradientClipping(boolean value)
A bool which decides if gradient will be clipped
The default value is NO
public void setGradientClipMax(float value)
The maximum value at which incoming gradient will be clipped before rescaling, applyGradientClipping must be true
public void setGradientClipMin(float value)
The minimum value at which incoming gradient will be clipped before rescaling, applyGradientClipping must be true
public void setGradientRescale(float value)
The gradientRescale at which we apply to incoming gradient values
The default value is 1.0
public void setLearningRate(float value)
The learningRate at which we update values
The default value is 0.001f
public void setRegularizationScale(float value)
The regularizationScale at which we apply L1 or L2 regularization, it gets ignored if regularization is None
The default value is 0.0
public void setRegularizationType(long value)
The regularizationType which we apply.
The default value is MPSRegularizationTypeNone
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()