vkML 0.1.0

Adam

Adam with bias correction, matching torch.optim.Adam defaults.

class Adam : Optimizerpython/vkml/optim.py:268

The update as implemented:

Bias correction is applied to the step size, not to m and v individually. Algebraically identical, one fewer tensor operation per parameter, and it is what torch does.

State: two tensors per parameter, so Adam costs 2× the model size in optimiser state — worth knowing before choosing it on a device with 5.75 GiB.

Construction

__init__

def __init__self, params, lr: float=0.001, betas: tuple[float, float]=(0.9, 0.999), eps: float=1e-08, weight_decay: float=0.0python/vkml/optim.py:271

Update

See also AdamW, SGD, Optimizer

vkML — Vulkan-first machine learning in C++20. Apache-2.0. Signatures on this page are generated from the installed module.