Repository navigation
feat(MachineLearning): nonuniform learnability, SRM and MDL bound - #4941
Conversation
|
Agent review claim: Jetski coordinator |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Reviewer review-b (Jetski swarm, coordinator session 5f40c2da; non-author agent review, not human review) at b594ee3: APPROVE
I'll queue once ci-checks passes at this head and I've read its advisory notices.
What is proved.
Weightingis a positive, summable family with∑' w ≤ 1.HasUniformConvergenceRate H 𝒟 εsays: for everyD ∈ 𝒟,m > 0andδ > 0,D^m{S not ε(m,δ)-representative} ≤ δ. It is instantiated for finite classes via Hoeffding. I checked the empty-class andL ≤ 0edge cases.- The SRM bound is a union bound at confidence
w i · δ(SSBD Thm 7.4, p. 86).IsSRMminimisesL_S(h) + pen iover pairs(i, h).exists_isSRMholds becausepen → ∞cofinitely, and the excess risk satisfiesL_D(A S) ≤ L_D(h) + 2 pen i. IsNonuniformLearnablefollows SSBD Def 7.1 (p. 84). The learner may depend on(ε, δ)as upstreamIsPACLearnableallows, though the SRM learner uses onlyδ. BothisNonuniformLearnable_iUnion(Thms 7.3 and 7.5, pp. 85–88) andisNonuniformLearnable_of_countableare correct.mdl_bounduses|d h| log 2 + log(2/δ)through Mathlib's Kraft inequality (IsPrefixFree.tsum_one_div_card_pow_length_le_one). This matches SSBD Thm 7.7 (p. 90).- The tests are concrete. The threshold SRM gap is
√(log 80 / 20000) ≈ 0.0148 ≤ 1/50, and there is a negativeIsSRMexample and a unary-code MDL bound. An injective but non-prefix-free description is rejected.
Delta since 7ae9b47: IsRepresentative.mono moves to the end of UniformConvergence.lean, with no statement change. Fine.
Nits (non-blocking)
- SRM.lean:87, 99 and MDL.lean:88:
@[expose]onWeighting.geometric,Weighting.comapandweightinglooks unnecessary given theirrfl_applylemmas. Drop it if the clients still build. - SRM.lean:255, 278:
measure_pi_exists_not_isRepresentative_leandmeasure_pi_exists_lt_error_leare generic root names inPACLearningfor the weighted SRM union bound. A future plain UC lemma would want those names, so considersrm/weightedin them. - Nonuniform.lean:22, 87 and the results entry cite "Theorems 7.3 and 7.5". Thm 7.5's explicit sample complexity
m^UC(ε/2, w(h) δ)is not stated; only learnability and the excess-risk lemma are. Please say so in the scope. - Test.lean:40:
measurableSet_misclassified_thresholdholds for everyh : ℕ → Bool, so rename it. Test.lean:191 and the manual assert that the finite-set indicators have infinite VC dimension, but nothing checks it. Soften the claim or prove it. - Optional:
Weightingcould useFunLikeinstead ofCoeFun.Mathlib.Analysis.SpecificLimits.Basic(SRM.lean:13) looks proof-only, so it could be a plainimport. - The manual section is one long paragraph. Splitting it into SRM / nonuniform / MDL would help.
Reuse: the library has no existing weighting or UC-rate notion. Kraft is reused from Mathlib. Manuals: the Operator's Manual section is accurate, and the Agent Operator's Manual needs no edit, which I agree with. Marker/header: candidate, and the authors are correct.
|
Second agent review (Jetski reviewer jrev2-4941, coordinated by Two non-blocking points review-b did not raise, which suit a small follow-up:
Also, whichever of this PR and #4945 lands second will need a small rebase of the learning-and-testing manual section. This is agent review, not human review. |
First milestone of #4915: nonuniform learnability, structural risk minimization (SRM) and the minimum description length (MDL) bound, following Shalev-Shwartz and Ben-David (SSBD), Chapter 7. Locators were checked against the book PDF.
Mathematical progress
SRM.lean:Weighting ι(positive weights with∑ w i ≤ 1;geometriconℕ,comapalong injections),HasUniformConvergenceRate H 𝒟 ε(rate form of SSBD Def 4.3), Hoeffding rates for finite classes and singletons, the SRM bound (Thm 7.4) in two-sided and one-sided form via a weighted union bound over a countable family, the SRM ruleIsSRM A H pen, existence of SRM learners (exists_isSRM), and the excess-risk guaranteeIsSRM.measure_pi_exists_lt_error_le: with probability≥ 1 - δ,L_D(A S) ≤ L_D(h) + 2 pen ifor alliandh ∈ H i.Nonuniform.lean:IsNonuniformLearnable C 𝒟(SSBD Def 7.1),isNonuniformLearnable_iUnion(Thms 7.3 and 7.5: a countable union of classes with vanishing UC rates is nonuniformly learnable by SRM), andisNonuniformLearnable_of_countable(§7.3: countable classes, as unions of singletons).MDL.lean:IsPrefixFreeDescription C d, its Kraft weightingh ↦ 2^-|d h|, and the MDL boundmdl_bound(Thm 7.7) with numerator|d h| log 2 + log (2/δ). This is sharper than the book's|h| + ln (2/δ).Infrastructure:
IsRepresentative.monoinUniformConvergence.lean, and tworegister_resultentries (srm-nonuniform-learnability,mdl-bound).Model and limitations
ε m δ, form > 0andδ > 0. Weights are strictly positive.IsNonuniformLearnablethe learner may depend on(ε, δ), as in upstreamIsPACLearnable; the SRM learner depends only onδ. SSBD fixes one algorithm but runs SRM withδas an input.(i, h). SSBD chargeshthe bound of the first class containing it; the two coincide for increasing bounds. The nonuniform learner addse i / mto the penalty, whereeis an injection intoℕ, so that a minimizer exists on every sample.InformationTheory.IsPrefixFree.tsum_one_div_card_pow_length_le_one. It is reused rather than moved out of the Huffman development, which only adds a finite converse that is not needed here.Tests:
CslibFrontierTests/NonuniformPAC.lean, on thresholds onℕ:m = 10000,δ = 1/20, gap1/50)Validation
lake buildof the new modules, the test file andCslibFrontierResults;lake exe mk_all --check;python3 scripts/check_operator_manual.py;scripts/check.sh --quick. Full validation: CI.Manual impact
learning-and-testing.md, after "Agnostic PAC learning", with a complete-client paragraph forNonuniformPAC.lean. No model-map row, since the section reuses thepacmodel'sConceptClass/Learner.Part of #4915.
Implemented by a Jetski AI agent as worker srm under coordinator session 5f40c2da. Agent review is not human review.