kumulant

Sgd

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

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].

Reach for Sgd when:

Constructors

Link copied to clipboard
constructor(learningRate: ScalarExpr = ConstantRate(1e-3))

Properties

Link copied to clipboard

Per-step learning-rate schedule. The expression is evaluated with the step counter as its x input; standard schedules (com.eignex.kumulant.stat.regression.glm.ConstantRate, com.eignex.kumulant.stat.regression.glm.StepDecay, com.eignex.kumulant.stat.regression.glm.ExponentialDecay) live in the GLM package. Any ScalarExpr works; 1.0 / (1.0 + Const(0.01) * X) for an inverse-time decay, for instance.

Functions

Link copied to clipboard
open override fun materialize(featureSize: Int, concurrency: Concurrency = Concurrency.None): Optimizer

Build a live optimizer instance over featureSize coordinates at the requested Concurrency. Each call returns a fresh optimizer with empty aux state; stats call this for each weight vector they want to track (one per output class for com.eignex.kumulant.stat.regression.SoftmaxRegressionStat).

Sgd

constructor(learningRate: ScalarExpr = ConstantRate(1e-3))(source)

learningRate

Per-step learning-rate schedule. The expression is evaluated with the step counter as its x input; standard schedules (com.eignex.kumulant.stat.regression.glm.ConstantRate, com.eignex.kumulant.stat.regression.glm.StepDecay, com.eignex.kumulant.stat.regression.glm.ExponentialDecay) live in the GLM package. Any ScalarExpr works; 1.0 / (1.0 + Const(0.01) * X) for an inverse-time decay, for instance.

materialize

open override fun materialize(featureSize: Int, concurrency: Concurrency = Concurrency.None): Optimizer(source)

Build a live optimizer instance over featureSize coordinates at the requested Concurrency. Each call returns a fresh optimizer with empty aux state; stats call this for each weight vector they want to track (one per output class for com.eignex.kumulant.stat.regression.SoftmaxRegressionStat).