Example 16.2: on ℝ, ψ(x)ₙ = e^{−x²/2} xⁿ/√n! into ℓ² has ⟨ψ(x), ψ(x')⟩ = e^{−(x−x')²/2}; the Gaussian kernel e^{−‖x−x'‖²/(2σ)} on ℝⁿ is a kernel
ProvedUnderstandingML.gaussian_kernelgaussian-kernelhilbert-spacekernel-methods
Example 16.2 (Gaussian Kernel). Let the original instance space be and consider the mapping where for each there is an element . Then . More generally, given , the Gaussian kernel implements an inner product in a (infinite-dimensional) feature space.
Formally: the map into with the stated inner products, and IsKernel for the Gaussian kernel on for every .
Preamble
import Definitions.Def_UnderstandingML_Kernel open MeasureTheory open scoped InnerProductSpace
Formal statement
namespace UnderstandingML
/-- **Example 16.2 (Gaussian Kernel)** (pp. 220–221). On `ℝ`, the mapping `ψ` with coordinates
`ψ(x)ₙ = (1/√n!) e^{−x²/2} xⁿ` into `ℓ²` satisfies `⟨ψ(x), ψ(x')⟩ = e^{−(x − x')²/2}`; more
generally, for every `σ > 0` the Gaussian kernel `K(x, x') = e^{−‖x − x'‖²/(2σ)}` on `ℝ^n`
implements an inner product in some Hilbert space. -/
theorem gaussian_kernel :
(∃ ψ : ℝ → lp (fun _ : ℕ ↦ ℝ) 2,
∀ x x' : ℝ, ⟪ψ x, ψ x'⟫_ℝ = Real.exp (-((x - x') ^ 2) / 2)) ∧
∀ (n : ℕ) (σ : ℝ), 0 < σ → IsKernel (gaussianKernel (n := n) σ) := by sorry
end UnderstandingML
Source
Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press 2014, doi:10.1017/CBO9781107298019, §16.2 pp. 220-221, Example 16.2 with its derivation and the general Gaussian kernel
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.