Adam
Adam optimizer (Adaptive moment estimation)
Follows Kingma et al. - Adam: A method for stochastic optimization
-
Undocumented
Declaration
Swift
public typealias ParamTensor = Tensor<Layer.Parameter, Layer.Device>
-
Declaration
Swift
public private(set) var model: Layer { get }
-
Undocumented
Declaration
Swift
public let useAMSGrad: Bool
-
Learning rate scaling factor
Declaration
Swift
public var learningRate: ParamTensor
-
Exponential decay rate for first moment
Declaration
Swift
public var beta1: ParamTensor
-
Exponential decay rate for second moment
Declaration
Swift
public var beta2: ParamTensor
-
Normalization scalar added to divisors
Declaration
Swift
public var epsilon: ParamTensor
-
Adam optimizer (Adaptive moment estimation)
Follows Kingma et al. - Adam: A method for stochastic optimization
Declaration
Swift
public init(model: Layer, learningRate: ParamTensor, useAMSGrad: Bool = false, beta1: ParamTensor = 0.9, beta2: ParamTensor = 0.999, epsilon: ParamTensor = 1e-8)
Parameters
model
Model to optimize
learningRate
Learning rate scaling factor
beta1
Exponential decay rate for first moment
beta2
Exponential decay rate for second moment
epsilon
Normalization scalar added to divisors
-
Resets the state of the optimizer
Declaration
Swift
public mutating func reset()
-
Declaration
Swift
public mutating func update(along gradients: [ParamTensor])
-
Declaration
Swift
public init(from decoder: Decoder) throws
-
Declaration
Swift
public func encode(to encoder: Encoder) throws