java.lang.Object
io.github.kirstenali.deepj.optimisers.AdamW
All Implemented Interfaces:
ParameterOptimizer

public final class AdamW extends Object implements ParameterOptimizer
AdamW optimizer with per-parameter state.

State is keyed by Parameter identity, and updates are applied in-place.

  • Constructor Summary

    Constructors
    Constructor
    Description
    AdamW(float lr, float beta1, float beta2, float eps, float weightDecay)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static AdamW
    defaultAdamW(float lr)
     
    float
    lr()
    Current learning rate.
    void
    setLr(float lr)
    Update the learning rate (e.g. from a warmup/cosine schedule).
    void
    step(List<Parameter> params)
    Update the provided parameters (one optimizer step).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AdamW

      public AdamW(float lr, float beta1, float beta2, float eps, float weightDecay)
  • Method Details

    • defaultAdamW

      public static AdamW defaultAdamW(float lr)
    • lr

      public float lr()
      Current learning rate.
    • setLr

      public void setLr(float lr)
      Update the learning rate (e.g. from a warmup/cosine schedule). Per-parameter moment state (m, v) is preserved.
    • step

      public void step(List<Parameter> params)
      Description copied from interface: ParameterOptimizer
      Update the provided parameters (one optimizer step).
      Specified by:
      step in interface ParameterOptimizer