§B.9 — recursion for α_l(θ), β_l(θ), and β_{L+1}(θ) = √2β_L(θ) + α_L(θ)² for a softmax output layer
ProvedCertDRO.NNSmooth.alpha_beta_recursionlipschitzneural-networksp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1smoothness
Let and be the constants (21) of a network with layer constants . Then:
- and ;
- for every ,
- for every ,
- whenever , equivalently
- if an -st layer has (for instance ), and (the softmax loss), then
Part 5 is how the paper reads off the constant of Corollary 4: the softmax loss is treated as one more layer of the network.
Formalization Note The paper writes "with "; that is a misprint, since (21) gives (empty sum) and , and the formalization follows (21). The paper's ratio is undefined when some ; part 3 states what the ratio means without dividing, and part 4 is the paper's form under . In Lean layers are 0-based (θ l, L0 l, L1 l are the paper's , , ), and in part 5 the identity layer enters only through .
Preamble
import Mathlib import Definitions.Def_CertDRO_NNSmooth_Network
Formal statement
namespace CertDRO.NNSmooth
open Network
/-- §B.9 (p. 46), the recursive form of the constants (21) (0-based: `L0 l = L⁰_{l+1}`,
`L1 l = L¹_{l+1}`, `θ l = θ_{l+1}`):
`α_0 = 1`, `β_0 = 0`, `α_{l+1} = L⁰_{l+1} ‖θ_{l+1}‖_op α_l`,
`β_{l+1} = L⁰_{l+1} ‖θ_{l+1}‖_op β_l + (L¹_{l+1}/(L⁰_{l+1})²) α_{l+1}²`, which is the paper's
`β_{l+1} = (α_{l+1}/α_l) β_l + (L¹_{l+1}/(L⁰_{l+1})²) α_{l+1}²` whenever `α_l ≠ 0`; and for an
`(L+1)`-st layer with `‖θ_{L+1}‖_op = 1`, `L⁰_{L+1} = √2` and `L¹_{L+1} = 1` (the softmax layer),
`β_{L+1} = √2 β_L + α_L²`. -/
theorem alpha_beta_recursion (N : Network) (L0 L1 : ℕ → ℝ) :
N.α L0 0 = 1 ∧ N.β L0 L1 0 = 0 ∧
(∀ l, N.α L0 (l + 1) = L0 l * ‖N.θ l‖ * N.α L0 l) ∧
(∀ l, N.β L0 L1 (l + 1) =
L0 l * ‖N.θ l‖ * N.β L0 L1 l + (L1 l / (L0 l) ^ 2) * N.α L0 (l + 1) ^ 2) ∧
(∀ l, N.α L0 l ≠ 0 → N.β L0 L1 (l + 1) =
(N.α L0 (l + 1) / N.α L0 l) * N.β L0 L1 l + (L1 l / (L0 l) ^ 2) * N.α L0 (l + 1) ^ 2) ∧
(∀ L, ‖N.θ L‖ = 1 → L0 L = Real.sqrt 2 → L1 L = 1 →
N.β L0 L1 (L + 1) = Real.sqrt 2 * N.β L0 L1 L + N.α L0 L ^ 2) := by sorry
end CertDRO.NNSmooth
Source
Sinha, Namkoong, Volpi, Duchi, Certifying Some Distributional Robustness with Principled Adversarial Training, arXiv:1710.10571v5, p. 46, §B.9 (recursive form of (21) and β_{L+1})
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.