Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.spsa

The Applied Higher-Order Functions cataloguesrc/rainbow/algorithms/proofs/ahof/spsa.clj3 definitions, 3 theorems

AHoF O7 SPSA (Simultaneous Perturbation Stochastic Approximation): estimate the gradient from the two-sided perturbation difference (f(x+cD) - f(x-cD))/(2cD); with 2cD=1 the numerator is perturbation-difference f-plus f-minus = f-plus - f-minus. Worked: 3-1=2. Values proved by signed cross-product equivalence. Proved native and axiom-free. Requires signed/subtract, signed/from-nnrat, signed/equivalent (all in the D63 checkpoint). Scope (measured by the kernel): this module has 2 worked instances (statements about specific values) and 1 definitional unfoldings (true by unfolding a definition). None of its theorems is a guarantee about the algorithm for all inputs; `lein verify rainbow.algorithms.proofs.ahof.spsa` prints this classification.

spsa/perturbation-difference

DefinitionSource, line 44

spsa/perturbation-difference :
  (x₁ x₂ : ℚ)
  → ℚ

ℚ = signed/SignedRational

spsa/difference-example

DefinitionSource, line 49

spsa/difference-example :
  → ℚ

ℚ = signed/SignedRational

spsa/flat-example

DefinitionSource, line 53

spsa/flat-example :
  → ℚ

ℚ = signed/SignedRational

spsa/perturbation-difference-unfold

TheoremHolds by unfolding a definitionNo axiomsSource, line 59

spsa/perturbation-difference-unfold :
  (a b : ℚ)
  → nat-grad/update a b = a - b

- = signed/subtract= = equality/Eqℚ = signed/SignedRational

spsa/difference-example-is-2

TheoremWorked exampleNo axiomsSource, line 67

spsa/difference-example-is-2 :
  → dfp/step-example = signed/from-nnrat 2

= = signed/equivalent: equality of rational values

spsa/flat-example-is-0

TheoremWorked exampleNo axiomsSource, line 72

spsa/flat-example-is-0 :
  → dfp/no-step = signed/from-nnrat 0

= = signed/equivalent: equality of rational values