klyn.math.nn.optimizers.Adam.apply
method
public override apply(parameter as NDArray<T>, gradient as NDArray<T>, gradientScale as Double = 1.0) as Void
Description

Updates moments and one parameter in place without altering the derivative. Uses bias-corrected moments: p -= rate * mHat / (sqrt(vHat) + epsilon).

Parameters
ParameterDescription
parameterMutable parameter tensor of any rank.
gradientScalePositive finite loss scale removed before the update.
gradientSame-shaped mean-reduced derivative.
Throws
  • ValueException for incompatible or identical tensors.
Example

optimizer.apply(weights, dw)