MPSNNOptimizer(3) MetalPerformanceShaders.framework MPSNNOptimizer(3)

MPSNNOptimizer

#import <MPSNNOptimizers.h>

Inherits MPSKernel.

Inherited by MPSNNOptimizerAdam, MPSNNOptimizerRMSProp, and MPSNNOptimizerStochasticGradientDescent.


(nonnull instancetype) - initWithDevice:
(void) - setLearningRate:


float learningRate
float gradientRescale
BOOL applyGradientClipping
float gradientClipMax
float gradientClipMin
float regularizationScale
MPSNNRegularizationType regularizationType

The MPSNNOptimizer base class, use one of the child classes, not to be directly used. 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.

- (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device

Standard init with default properties per filter type

Parameters:

device The device that the filter will be used on. May not be NULL.

Returns:

a pointer to the newly initialized object. This will fail, returning nil if the device is not supported. Devices must be MTLFeatureSet_iOS_GPUFamily2_v1 or later.

Reimplemented from MPSKernel.

Reimplemented in MPSNNOptimizerAdam, MPSNNOptimizerRMSProp, and MPSNNOptimizerStochasticGradientDescent.

- (void) setLearningRate: (float) newLearningRate

- applyGradientClipping [read], [write], [nonatomic], [assign]

A bool which decides if gradient will be clipped The default value is NO

- gradientClipMax [read], [nonatomic], [assign]

The maximum value at which incoming gradient will be clipped before rescaling, applyGradientClipping must be true

- gradientClipMin [read], [nonatomic], [assign]

The minimum value at which incoming gradient will be clipped before rescaling, applyGradientClipping must be true

- gradientRescale [read], [nonatomic], [assign]

The gradientRescale at which we apply to incoming gradient values The default value is 1.0

- learningRate [read], [nonatomic], [assign]

The learningRate at which we update values The default value is 1e-3

- regularizationScale [read], [nonatomic], [assign]

The regularizationScale at which we apply L1 or L2 regularization, it gets ignored if regularization is None The default value is 0.0

- regularizationType [read], [nonatomic], [assign]

The regularizationType which we apply. The default value is MPSRegularizationTypeNone

Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.

Mon Jul 9 2018 Version MetalPerformanceShaders-119.3