quantax.optimizer.MarchUpdater#

class quantax.optimizer.MarchUpdater#

Bases: Updater

The MARCH update, a variant of SR with first and second order momentum stored in the phi and v buffers.

If the proposed step or the new second-order momentum contains non-finite values, both buffers are left unchanged, so a single corrupted iteration can’t poison the accumulated momentum. The non-finite step is still returned and is expected to be rejected by update.

__init__(mu: float = 0.95, beta: float = 0.995)#
Parameters:
  • mu – The first order momentum factor.

  • beta – The second order momentum factor.

init(nparams: int) → dict[str, Array]#

Initialize the persistent buffers for nparams parameters.

update(core_solve: Callable[[...], Array], Obar: Array, Ebar: Array, buffers: dict[str, Array]) → tuple[Array, dict[str, Array]]#

Generate the optimization step and the new buffers, given the equation solver core_solve and the current buffers.