weightDecay
TypeScriptget weightDecay(): numberSwift declarationvar weightDecay: Float { get set }The weight decay coefficient.
struct · iOS 15.0+ · SDK 27.1
struct AdamWOptimizerA structure that updates parameters according to AdamW algorithm.
get weightDecay(): numberSwift declarationvar weightDecay: Float { get set }The weight decay coefficient.
set weightDecay(value: number)Swift declarationvar weightDecay: Float { get set }The weight decay coefficient.
static init(learningRate: number, beta1: number, beta2: number, timeStep: number, epsilon: number, gradientScale: number, weightDecay: number, gradientClipping: BNNS_GradientClipping, usesAMSGrad?: boolean): BNNS_AdamWOptimizerSwift declarationinit(learningRate: Float = 0.001, beta1: Float = 0.9, beta2: Float = 0.999, timeStep: Float = 1, epsilon: Float = 1e-8, gradientScale: Float, weightDecay: Float = 1e-2, gradientClipping: BNNS.GradientClipping, usesAMSGrad: Bool = false)Returns a new AdamW optimizer. - Parameter learningRate: The optimizer learning rate. - Parameter beta1: First moment constant, in the range [0,1). - Parameter beta1: Second moment constant, in the range [0,1). - Parameter timeStep: The optimizer time step. You are responsible for maintaining the time step. Set the initial value to `1`, and increase by `1` after optimizing all of the layer parameters in the network. - Parameter epsilon: An addition for the division in the parameter update stage. - Parameter gradientScale: Gradient scaling factor. - Parameter weightDecay: The weight decay coefficient. - Parameter gradientClipping: The gradient clipping. - Parameter useAMSGrad: A Boolean value that specifies whether to use the AMSGrad variant.
get learningRate(): numberSwift declarationvar learningRate: Float { get set }The optimizer learning rate.
set learningRate(value: number)Swift declarationvar learningRate: Float { get set }The optimizer learning rate.
get gradientScale(): numberSwift declarationvar gradientScale: Float { get set }Gradient scaling factor.
set gradientScale(value: number)Swift declarationvar gradientScale: Float { get set }Gradient scaling factor.
get gradientClipping(): BNNS_GradientClippingSwift declarationvar gradientClipping: BNNS.GradientClipping { get set }The gradient clipping.
set gradientClipping(value: BNNS_GradientClipping)Swift declarationvar gradientClipping: BNNS.GradientClipping { get set }The gradient clipping.
get bnnsOptimizerFunction(): BNNSOptimizerFunctionSwift declarationvar bnnsOptimizerFunction: BNNSOptimizerFunction { get }The underlying `BNNSOptimizerFunction`.
get accumulatorCountMultiplier(): numberSwift declarationvar accumulatorCountMultiplier: Int { get }The number of accumulators required for each parameter.
get beta1(): numberSwift declarationvar beta1: Float { get set }First moment constant, in the range [0,1).
set beta1(value: number)Swift declarationvar beta1: Float { get set }First moment constant, in the range [0,1).
get beta2(): numberSwift declarationvar beta2: Float { get set }Second moment constant, in the range [0,1).
set beta2(value: number)Swift declarationvar beta2: Float { get set }Second moment constant, in the range [0,1).
get epsilon(): numberSwift declarationvar epsilon: Float { get set }An addition for the division in the parameter update stage.
set epsilon(value: number)Swift declarationvar epsilon: Float { get set }An addition for the division in the parameter update stage.
get timeStep(): numberSwift declarationvar timeStep: Float { get set }The optimizer time step. You are responsible for maintaining the time step. Set the initial value to `1`, and increase by `1` after optimizing all of the layer parameters in the network.
set timeStep(value: number)Swift declarationvar timeStep: Float { get set }The optimizer time step. You are responsible for maintaining the time step. Set the initial value to `1`, and increase by `1` after optimizing all of the layer parameters in the network.
No declarations were skipped in this snapshot.