Download data/lean/OAI/Probability/PosteriorReplicas/Regression/LearnerBasics.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.79 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/PosteriorReplicas/Regression/LearnerBasics.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/PosteriorReplicas/Regression/LearnerBasics.lean
-
curl -L -o LearnerBasics.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/PosteriorReplicas/Regression/LearnerBasics.lean
3.79 kB
Lean 4 Β· 10
declarations fullstatements
| import OAI.Probability.PosteriorReplicas.Model | |
| namespace OAI | |
| open MeasureTheory ProbabilityTheory Set Filter | |
| open scoped ENNReal NNReal RealInnerProductSpace | |
| noncomputable section | |
| universe u | |
| namespace PosteriorRegression | |
| structure Learner (d M T : β) (Ξ© : Type u) where | |
| initialChoice : Ξ© β Bool Γ State M | |
| transition : β β Ξ© β State M β (Vector d Γ β) β Bool Γ State M | |
| output : β β Ξ© β State M β UnitSphere d | |
| namespace Learner | |
| def start {d M T : β} {Ξ© : Type u} (L : Learner d M T Ξ©) (Ο : Ξ©) : | |
| RunStatus M := | |
| let a := L.initialChoice Ο | |
| if a.1 then .inr (0, a.2) else .inl a.2 | |
| def run {d M T : β} {Ξ© : Type u} (L : Learner d M T Ξ©) | |
| (s : UnitSphere d) (Ο : Ξ©) (x : Samples d T) : β β RunStatus M | |
| | 0 => L.start Ο | |
| | n + 1 => | |
| match L.run s Ο x n with | |
| | .inr done => .inr done | |
| | .inl state => | |
| if hn : n < T then | |
| let row := x β¨n, hnβ© | |
| let a := L.transition (n + 1) Ο state (row, βͺrow, s.valβ«) | |
| if a.1 then .inr (n + 1, a.2) else .inl a.2 | |
| else .inl state | |
| def terminal {d M T : β} {Ξ© : Type u} (L : Learner d M T Ξ©) | |
| (s : UnitSphere d) (Ο : Ξ©) (x : Samples d T) : β Γ State M := | |
| match L.run s Ο x T with | |
| | .inl state => (T, state) | |
| | .inr done => done | |
| def estimate {d M T : β} {Ξ© : Type u} (L : Learner d M T Ξ©) | |
| (s : UnitSphere d) (Ο : Ξ©) (x : Samples d T) : UnitSphere d := | |
| let a := L.terminal s Ο x | |
| L.output a.1 Ο a.2 | |
| structure Admissible {d M T : β} {Ξ© : Type u} [MeasurableSpace Ξ©] | |
| (L : Learner d M T Ξ©) (Ο : Measure Ξ©) : Prop where | |
| initialChoice : AEMeasurable L.initialChoice Ο | |
| transition : β t a, AEMeasurable (fun z : Ξ© Γ (Vector d Γ β) => | |
| L.transition t z.1 a z.2) (Ο.prod (observationReference d)) | |
| output : β t a, AEMeasurable (fun Ο => L.output t Ο a) Ο | |
| fixed_experiment : β s, AEMeasurable (fun z : Ξ© Γ Samples d T => | |
| L.estimate s z.1 z.2) (Ο.prod (sampleLaw d T)) | |
| uniform_experiment : AEMeasurable | |
| (fun z : UnitSphere d Γ (Ξ© Γ Samples d T) => L.estimate z.1 z.2.1 z.2.2) | |
| ((uniformSphere d).prod (Ο.prod (sampleLaw d T))) | |
| def success {d M T : β} {Ξ© : Type u} [MeasurableSpace Ξ©] | |
| (L : Learner d M T Ξ©) (Ο : Measure Ξ©) (Ξ΅ : β) (s : UnitSphere d) : ββ₯0β := | |
| (Ο.prod (sampleLaw d T)) | |
| {z | angularError s (L.estimate s z.1 z.2) β€ Ξ΅} | |
| def uniformSuccess {d M T : β} {Ξ© : Type u} [MeasurableSpace Ξ©] | |
| (L : Learner d M T Ξ©) (Ο : Measure Ξ©) (Ξ΅ : β) : ββ₯0β := | |
| ((uniformSphere d).prod (Ο.prod (sampleLaw d T))) | |
| {z | angularError z.1 (L.estimate z.1 z.2.1 z.2.2) β€ Ξ΅} | |
| end Learner | |
| def SubquadraticMemory : Prop := | |
| β c : β, 0 < c β§ β M : β β β, | |
| Asymptotics.IsLittleO atTop (fun d => (M d : β)) (fun d => (d : β) ^ 2) β | |
| β dβ : β, β d : β, dβ β€ d β β T : β, β Ξ΅ : β, | |
| 0 < Ξ΅ β Ξ΅ β€ 1 / 10 β | |
| β (Ξ© : Type u) [MeasurableSpace Ξ©] (Ο : Measure Ξ©), IsProbabilityMeasure Ο β | |
| β L : Learner d (M d) T Ξ©, L.Admissible Ο β | |
| ((2 / 3 : ββ₯0β) β€ L.uniformSuccess Ο Ξ΅ β¨ | |
| β s, (2 / 3 : ββ₯0β) β€ L.success Ο Ξ΅ s) β | |
| c * (d : β) * Real.log (1 / Ξ΅) β€ (T : β) | |
| def FixedQuadraticMemory : Prop := | |
| β Aβ : β, 0 < Aβ β β c : β, 0 < c β§ β dβ : β, | |
| β d : β, dβ β€ d β β M T : β, (M : β) β€ Aβ * (d : β) ^ 2 β | |
| β Ξ΅ : β, 0 < Ξ΅ β Ξ΅ β€ 1 / 10 β | |
| β (Ξ© : Type u) [MeasurableSpace Ξ©] (Ο : Measure Ξ©), IsProbabilityMeasure Ο β | |
| β L : Learner d M T Ξ©, L.Admissible Ο β | |
| (2 / 3 : ββ₯0β) β€ L.uniformSuccess Ο Ξ΅ β | |
| c * (d : β) * Real.log (1 / Ξ΅) β€ (T : β) | |
| open scoped Topology | |
| end PosteriorRegression | |
| end | |
| end OAI | |
Outline