kumulant

Optimizer

sealed interface Optimizer(source)

Online optimizer strategy. Given a per-coordinate raw gradient, returns the delta to add to that weight cell. Owns any per-coordinate auxiliary state (Adam's first/second moments, Adagrad's running squared gradient, etc.).

Lifecycle, called by the host stat once per update:

  1. advance; bump per-update counters (Adam's step t).

  2. For each touched coordinate, computeDelta; return the weight delta.

  3. The host stat applies the delta to its weight cell.

Stateless optimizers (Sgd) ignore advance. Concurrency: per-coordinate aux state honours the Concurrency passed at materialization; multi-cell coupled state (Adam) uses Welford locking semantics.

Inheritors

Properties

Link copied to clipboard
abstract val featureSize: Int

Number of weight coordinates this optimizer manages.

Functions

Link copied to clipboard
open fun advance()

Advance per-update counters (Adam step t, etc.). Called once per stat update.

Link copied to clipboard
abstract fun computeDelta(coordIndex: Int, gradient: Double, observationWeight: Double): Double

Per-coordinate update. Reads/writes any auxiliary state owned by the optimizer, then returns the delta the caller should add to w[coordIndex].

Link copied to clipboard
abstract fun reset()

Reset all internal state to its initial values.

advance

open fun advance()(source)

Advance per-update counters (Adam step t, etc.). Called once per stat update.

computeDelta

abstract fun computeDelta(coordIndex: Int, gradient: Double, observationWeight: Double): Double(source)

Per-coordinate update. Reads/writes any auxiliary state owned by the optimizer, then returns the delta the caller should add to w[coordIndex].

featureSize

abstract val featureSize: Int(source)

Number of weight coordinates this optimizer manages.

reset

abstract fun reset()(source)

Reset all internal state to its initial values.