Stochastic gradient descent for convex Lipschitz losses #
Projected stochastic gradient descent minimizes the true risk L_D(w) = ∫ ℓ w z ∂D of a convex
loss over a convex set K from an i.i.d. sample S = (z₀, …, z_{T-1}). In step t it takes a
subgradient g x (S t) of the loss ℓ · (S t) at the current point x and moves against it:
x 0 = x₀, x (t + 1) = proj (x t - η t • g (x t) (S t)),
which is online gradient descent (OCO.ogd) on the losses ℓ · (S t). Since x t depends only
on S 0, …, S (t - 1), the online-to-batch conversion
(OnlineLearning.integral_trueRisk_average_le_add) turns the regret bound of online gradient
descent into a bound on the expected true risk of the average iterate. With step size
B / (ρ √T), subgradients of norm at most ρ on K and a comparator u ∈ K with
‖x₀ - u‖ ≤ B, this is
𝔼_S L_D ((1 / T) ∑ t < T, x t) ≤ L_D u + B ρ / √T
[ShalevShwartzBenDavid2014, Theorem 14.8, Corollary 14.12] (locators unverified).
K may be the whole space with proj = id, as in the source's unconstrained analysis; the only
integrability hypothesis is that ℓ x₀ is D-integrable. Measurability of proj, ℓ and g
makes the iterates measurable functions of the sample. For K = Set.univ the projection is the
identity; the metric projection onto a nonempty complete convex set is Lipschitz
(lipschitzWith_metricProjection), hence measurable.
The bound is in expectation. High-probability bounds, the log T / T rates for strongly convex
losses, and running time are not treated here.
Main definitions #
Cslib.MachineLearning.sgd: the iterates of projected stochastic gradient descent on a sample.
Main results #
Cslib.MachineLearning.sgd_def:sgdis online gradient descent on the sample's losses.Cslib.MachineLearning.measurable_sgd,Cslib.MachineLearning.sgd_update: each iterate is a measurable function of the sample, and iteratetdoes not depend on examplet.Cslib.MachineLearning.integral_trueRisk_sgd_average_le: the expected true risk of the average of the firstTiterates is at mostL_D u + B ρ / √T.
References #
- S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Sections 14.3 and 14.5 (locators unverified)
The iterates of projected stochastic gradient descent with projection proj, step sizes
η, subgradient oracle g and starting point x₀ on the sample S:
x (t + 1) = proj (x t - η t • g (x t) (S t)) for t < T. After the sample is exhausted the
subgradients are 0.
Iterate t of stochastic gradient descent depends only on the examples before t.
Iterate t of stochastic gradient descent does not depend on example t.
Each iterate of stochastic gradient descent is a measurable function of the sample.
Stochastic gradient descent for convex Lipschitz losses
[ShalevShwartzBenDavid2014, Theorem 14.8, Corollary 14.12] (locators unverified). Let g x z be
a subgradient of the loss ℓ · z at x ∈ K relative to the convex set K, of norm at most ρ,
and let ℓ x₀ be D-integrable. For a comparator u ∈ K with ‖x₀ - u‖ ≤ B, projected SGD with
step size B / (ρ √T) on T i.i.d. examples from D satisfies
𝔼_S L_D ((1 / T) ∑ t < T, x t) ≤ L_D u + B ρ / √T.