abbrev
definition
Vec
show as:
view math explainer →
open explainer
Generate a durable explainer page for this declaration.
open lean source
IndisputableMonolith.Cost.Ndim.Core on GitHub at line 18.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
used by
-
additive_decomposition -
additiveQuadratic -
compensatory_nonneg_of_sqNorm_le_one -
compensatoryQuadratic -
dot_sq_le_sqNorm_mul -
multiplicative_le_additive_of_sqNorm_le_one -
multiplicativeQuadratic -
sqNorm -
sqNorm_uniform -
uniform_sqNorm_one -
uniform_weight_of_sum_one -
UniformWeights -
weightSum -
weightSum_uniform -
not_projectivelyEquivalentToZeroAt_tPulledConnection -
projectivelyEquivalent_one_dim -
ProjectivelyEquivalentToZeroAt -
tPulledConnection -
tPulledConnection_diag -
tPulledConnection_offDiag -
xFlatConnection -
xFlatConnection_apply -
aggregate -
aggregate_pos -
dot -
dot_log_hadamardDiv -
dot_log_hadamardInv -
dot_log_hadamardMul -
hadamardDiv -
hadamardInv -
hadamardMul -
JcostN -
JcostN_eq_cosh_logsum -
JcostN_eq_Jcost_aggregate -
JcostN_eq_zero_iff -
JcostN_nonneg -
JcostN_reciprocal -
JcostN_unit -
JlogN -
JlogN_eq_cosh_sub_one
formal source
15open scoped BigOperators
16
17/-- `n`-component real vectors as coordinate functions. -/
18abbrev Vec (n : ℕ) := Fin n → ℝ
19
20/-- Weighted dot product used by the logarithmic aggregate. -/
21def dot {n : ℕ} (α t : Vec n) : ℝ := ∑ i : Fin n, α i * t i
22
23/-- Componentwise logarithm. -/
24noncomputable def logVec {n : ℕ} (x : Vec n) : Vec n := fun i => Real.log (x i)
25
26/-- Componentwise multiplication. -/
27def hadamardMul {n : ℕ} (x y : Vec n) : Vec n := fun i => x i * y i
28
29/-- Componentwise inversion. -/
30noncomputable def hadamardInv {n : ℕ} (x : Vec n) : Vec n := fun i => (x i)⁻¹
31
32/-- Componentwise division. -/
33noncomputable def hadamardDiv {n : ℕ} (x y : Vec n) : Vec n := fun i => x i / y i
34
35/-- Exponential aggregate `R(x) = exp(∑ αᵢ log xᵢ)`. -/
36noncomputable def aggregate {n : ℕ} (α x : Vec n) : ℝ :=
37 Real.exp (dot α (logVec x))
38
39/-- Log-coordinate `n`-dimensional cost. -/
40noncomputable def JlogN {n : ℕ} (α t : Vec n) : ℝ :=
41 Jcost (Real.exp (dot α t))
42
43/-- Original positive-coordinate `n`-dimensional cost. -/
44noncomputable def JcostN {n : ℕ} (α x : Vec n) : ℝ :=
45 JlogN α (logVec x)
46
47@[simp] theorem aggregate_pos {n : ℕ} (α x : Vec n) : 0 < aggregate α x := by
48 unfold aggregate