LeanMachineLearning exposition

Learning.roundRobinAlgorithm๐Ÿ”—

This page has the declaration's own card below, then its dependency graph, then a card for each dependency (type dependencies first, then the rest of the transitive closure). For a theorem, the graph and the dependency cards only follow its statement's dependencies (its proof is replaced by sorry, so what it proves doesn't depend on how); for everything else, both the type and the body/value are followed, since their content is part of what later declarations build on.

Minimal Lean file

roundRobinAlgorithm๐Ÿ”—

DefinitionLearning.roundRobinAlgorithm

The Round-Robin algorithm: deterministic algorithm that chooses action n % K at time n.

๐Ÿ”—def
Learning.roundRobinAlgorithm.{u_1} {๐“จ : Type u_1} {m๐“จ : MeasurableSpace ๐“จ} {K : โ„•} (hK : 0 < K) : Algorithm (Fin K) ๐“จ
Learning.roundRobinAlgorithm.{u_1} {๐“จ : Type u_1} {m๐“จ : MeasurableSpace ๐“จ} {K : โ„•} (hK : 0 < K) : Algorithm (Fin K) ๐“จ

Code

noncomputable
def roundRobinAlgorithm (hK : 0 < K) : Algorithm (Fin K) ๐“จ :=
  detAlgorithm (fun n _ โ†ฆ RoundRobin.nextAction hK n) (by fun_prop) โŸจ0, hKโŸฉ
Type uses (1)
Body uses (2)
Used by (13)

Actions: Source ยท Open Issue

Dependency graph

Type dependencies (1)

Algorithm๐Ÿ”—

StructureLearning.Algorithm

A stochastic, sequential algorithm.

๐Ÿ”—structure
Learning.Algorithm.{u_4, u_5} (๐“ : Type u_4) (๐“จ : Type u_5) [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] : Type (max u_4 u_5)
Learning.Algorithm.{u_4, u_5} (๐“ : Type u_4) (๐“จ : Type u_5) [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] : Type (max u_4 u_5)

Code

structure Algorithm (๐“ ๐“จ : Type*) [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] where
  /-- Policy or sampling rule: distribution of the next action. -/
  policy : (n : โ„•) โ†’ Kernel (Iic n โ†’ ๐“ ร— ๐“จ) ๐“
  /-- The policy is a Markov kernel. -/
  [h_policy : โˆ€ n, IsMarkovKernel (policy n)]
  /-- Distribution of the first action. -/
  p0 : Measure ๐“
  /-- The first action distribution is a probability measure. -/
  [hp0 : IsProbabilityMeasure p0]
Used by (216)

Actions: Source ยท Open Issue

All dependencies, transitively (2)

detAlgorithm๐Ÿ”—

DefinitionLearning.detAlgorithm

A deterministic algorithm, which chooses the action given by the function nextAction.

๐Ÿ”—def
Learning.detAlgorithm.{u_1, u_2} {๐“ : Type u_1} {๐“จ : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“จ : MeasurableSpace ๐“จ} (nextA : (n : โ„•) โ†’ (โ†ฅ(Finset.Iic n) โ†’ ๐“ ร— ๐“จ) โ†’ ๐“) (h_next : โˆ€ (n : โ„•), Measurable (nextA n)) (action0 : ๐“) : Algorithm ๐“ ๐“จ
Learning.detAlgorithm.{u_1, u_2} {๐“ : Type u_1} {๐“จ : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“จ : MeasurableSpace ๐“จ} (nextA : (n : โ„•) โ†’ (โ†ฅ(Finset.Iic n) โ†’ ๐“ ร— ๐“จ) โ†’ ๐“) (h_next : โˆ€ (n : โ„•), Measurable (nextA n)) (action0 : ๐“) : Algorithm ๐“ ๐“จ

Code

noncomputable
def detAlgorithm (nextA : (n : โ„•) โ†’ (Iic n โ†’ ๐“ ร— ๐“จ) โ†’ ๐“)
    (h_next : โˆ€ n, Measurable (nextA n)) (action0 : ๐“) :
    Algorithm ๐“ ๐“จ where
  policy n := Kernel.deterministic (nextA n) (h_next n)
  p0 := Measure.dirac action0
Type uses (1)
Used by (15)

Actions: Source ยท Open Issue

nextAction๐Ÿ”—

DefinitionLearning.RoundRobin.nextAction

Action chosen by the Round-Robin algorithm at time n + 1. This is action (n + 1) % K.

๐Ÿ”—def
Learning.RoundRobin.nextAction {K : โ„•} (hK : 0 < K) (n : โ„•) : Fin K
Learning.RoundRobin.nextAction {K : โ„•} (hK : 0 < K) (n : โ„•) : Fin K

Code

noncomputable
def RoundRobin.nextAction (hK : 0 < K) (n : โ„•) : Fin K := โŸจ(n + 1) % K, Nat.mod_lt _ hKโŸฉ
Used by (14)

Actions: Source ยท Open Issue