LeanMachineLearning exposition

Learning.sumRewards'🔗

Minimal Lean file

sumRewards'🔗

DefinitionLearning.sumRewards'

Sum of rewards of arm a up to (and including) time n.

🔗def
Learning.sumRewards'.{u_1} {𝓐 : Type u_1} [DecidableEq 𝓐] (n : ) (h : (Finset.Iic n) 𝓐 × ) (a : 𝓐) :
Learning.sumRewards'.{u_1} {𝓐 : Type u_1} [DecidableEq 𝓐] (n : ) (h : (Finset.Iic n) 𝓐 × ) (a : 𝓐) :

Code

noncomputable
def sumRewards' (n : ℕ) (h : Iic n → 𝓐 × ℝ) (a : 𝓐) :=
  ∑ s, if (h s).1 = a then (h s).2 else 0
Used by (9)

Actions: Source · Open Issue