kumulant

schema.optimizer

The wire-portable optimizer strategies that the online linear-model stats take to pick their per-coordinate update rule. An OptimizerSpec is pure configuration: it carries the learning-rate schedule and the optimizer's hyperparameters, and materializes into a live optimizer in com.eignex.kumulant.stat.regression when the stat is built. As with every spec, the concurrency mode is supplied at materialize time rather than stored on the wire.

Choosing one

Sgd is plain stochastic gradient descent: the cheapest path, stateless apart from the step counter, and the only optimizer that supports the L1/L2 penalties on the regression stats. Adagrad gives each coordinate its own adaptive rate, which suits sparse, power-law features where rare features should learn faster than common ones. Rmsprop replaces Adagrad's monotonically shrinking rate with an exponential moving average of squared gradients, so learning doesn't stall on long streams. Adam is the general-purpose default, combining bias-corrected first and second moment estimates.

All four are consumed by com.eignex.kumulant.stat.regression.glm.StochasticRegressionStat and com.eignex.kumulant.stat.regression.SoftmaxRegressionStat. A multi-output stat builds one live optimizer per output class from the same spec, so the configuration is shared while the per-coordinate state is not.

Types

Link copied to clipboard
@Serializable
@SerialName(value = "Adagrad")
data class Adagrad(val learningRate: ScalarExpr = ConstantRate(0.01), val epsilon: Double = 1.0E-10) : OptimizerSpec

Adagrad. Per-coordinate adaptive learning rate via accumulated squared gradients: w[i] -= lr * grad[i] / sqrt(sumG2[i] + epsilon).

Link copied to clipboard
@Serializable
@SerialName(value = "Adam")
data class Adam(val learningRate: ScalarExpr = ConstantRate(0.001), val beta1: Double = 0.9, val beta2: Double = 0.999, val epsilon: Double = 1.0E-8) : OptimizerSpec

Adam. Bias-corrected first and second moments per coordinate (Kingma & Ba 2015); the general-purpose default in modern online learning. Per-coordinate update:

Link copied to clipboard
@Serializable
sealed interface OptimizerSpec

Wire-portable optimizer strategy. Sealed root of Sgd / Adagrad / Rmsprop / Adam; consumed by the online linear-model stats (com.eignex.kumulant.stat.regression.glm.StochasticRegressionStat, com.eignex.kumulant.stat.regression.SoftmaxRegressionStat) to pick the per-coordinate update rule.

Link copied to clipboard
@Serializable
@SerialName(value = "Rmsprop")
data class Rmsprop(val learningRate: ScalarExpr = ConstantRate(0.01), val rho: Double = 0.9, val epsilon: Double = 1.0E-8) : OptimizerSpec

RMSProp. Per-coordinate adaptive learning rate via an exponential moving average of squared gradients: the same shape as Adagrad but with a sliding window instead of a monotone accumulator.

Link copied to clipboard
@Serializable
@SerialName(value = "Sgd")
data class Sgd(val learningRate: ScalarExpr = ConstantRate(1e-3)) : OptimizerSpec

Plain stochastic gradient descent. The default and the cheapest entry; stateless apart from the global step counter feeding the learning-rate schedule. Per-coordinate update: w[i] -= lr(step) * weight * grad[i].