Latent spaces, positive-pair conditionals, cross-entropies and InfoNCE objectives of Zimmermann et al. (2021)
DefinitionContrastiveInverts_BasicObjects of Section 3, Definition 1 and Appendices A.1.1 and A.2.1 of Zimmermann, Sharma, Schneider, Bethge and Brendel (2021). Observations are for latents , an encoder is trained on observations, and every objective depends on only through , so it is written on latents.
- Hypersphere. carries its surface measure , of total mass . The marginal is uniform, .
- von Mises–Fisher conditional (eq. 2). with .
- Model conditional (eq. 4). For , with .
- Cross-entropies. at a fixed anchor , and its average .
- InfoNCE (eq. 1). With drawn as , , and negatives i.i.d. uniform,
The objective minimised "for " is . 6. Convex bodies. is compact and convex with nonempty interior, carries Lebesgue measure, has volume and uniform marginal . 7. (Semi-)metrics induced by a norm (eq. 5, Lemma 1). for a norm on and a continuous bijection of with ( is the metric case). The metric is . 8. Exponential conditional (eq. 5, Appendix A.2.1). For , with . Eq. (5) is the case . 9. Model conditional (eq. 7). with . The cross-entropies are defined as in item 4, with Lebesgue measure on . 10. General InfoNCE (Definition 1, eq. 6).
with positive pairs from and i.i.d. uniform negatives. Its alignment and uniformity parts (Proposition 3) are and , where is the uniform marginal.
Formalization Note The ground-truth distance (with ) and the model distance (with ) are separate arguments of the convex-body objectives, so that Theorem 6 can use a model distance equal to a constant multiple of the ground-truth one. is defined as a function of the anchor ; on the sphere this is the paper's constant, by rotation invariance. The objective "for " is Lean's limUnder, which equals the true limit whenever the limit exists; Theorem 1 asserts that it exists for every measurable encoder with values in a sphere (under the standing assumptions on ), and Theorem 3 for every encoder with values in the convex body that is a.e.-measurable.
import Mathlib
/-!
Zimmermann, Sharma, Schneider, Bethge and Brendel, *Contrastive Learning Inverts the Data
Generating Process*, ICML 2021, arXiv:2102.08850v4: the latent spaces, ground-truth and model
conditional distributions, cross-entropies and InfoNCE objectives of Section 3, Definition 1 and
Appendices A.1.1 and A.2.1 (PDF pp. 2-5, 13-18).
Hypersphere setting (Sections 3.1-3.2, Appendix A.1): latents live on the unit sphere
`S^{N-1} ⊂ ℝ^N` with its surface measure, the marginal is uniform and positive pairs follow a
von Mises-Fisher conditional. Convex-body setting (Section 3.3, Appendix A.2): latents live in a
convex body `Z ⊂ ℝ^N` with Lebesgue measure, the marginal is uniform and the conditional is
`∝ exp(-λ δ(z̃, z))` for a (semi-)metric `δ` induced by a norm. Objectives are written in terms of
`h = f ∘ g`, as in the paper, since observations are `x = g(z)`.
-/
open MeasureTheory Filter
noncomputable section
namespace ContrastiveInverts
/-- Section 3: the latent and representation space `ℝ^N`, with its Euclidean inner product. -/
abbrev Vec (N : ℕ) := EuclideanSpace ℝ (Fin N)
/-- Section 3 and Appendix A.1.1: the unit hypersphere `Z = S^{N-1} ⊂ ℝ^N`, as a type. -/
abbrev Sph (N : ℕ) := Metric.sphere (0 : Vec N) 1
/-- Section 3, eq. (2): the surface (Hausdorff) measure on `S^{N-1}`, against which `dz̃` in the
normalising constants is taken. -/
def sphereMeasure (N : ℕ) : Measure (Sph N) := (volume : Measure (Vec N)).toSphere
/-- Section 3, eq. (2) and Theorem 1: `|Z|`, the surface area of `S^{N-1}`. -/
def sphereArea (N : ℕ) : ℝ := (sphereMeasure N Set.univ).toReal
/-- Section 3, eq. (2): the uniform marginal `p(z) = |Z|^{-1}` on `S^{N-1}`. -/
def sphereUnif (N : ℕ) : Measure (Sph N) := (sphereMeasure N Set.univ)⁻¹ • sphereMeasure N
/-- Eq. (2) and Appendix A.1.1: the von Mises-Fisher normalising constant
`C_p = ∫ exp(κ zᵀ z̃) dz̃` (independent of `z` by rotation invariance). -/
def vmfConst (N : ℕ) (κ : ℝ) (z : Vec N) : ℝ :=
∫ w : Sph N, Real.exp (κ * inner ℝ z (w : Vec N)) ∂sphereMeasure N
/-- Eq. (2): the von Mises-Fisher conditional of positive pairs,
`p(z̃ | z) = C_p^{-1} exp(κ zᵀ z̃)`, a density with respect to the surface measure. -/
def vmfCond (N : ℕ) (κ : ℝ) (z z' : Vec N) : ℝ :=
Real.exp (κ * inner ℝ z z') / vmfConst N κ z
/-- Theorem 1, eq. (4): the partition function `C_h(z) = ∫ exp(h(z̃)ᵀ h(z) / τ) dz̃` of the model
conditional. -/
def sphModelConst {N : ℕ} (τ : ℝ) (h : Vec N → Vec N) (z : Vec N) : ℝ :=
∫ w : Sph N, Real.exp (inner ℝ (h w) (h z) / τ) ∂sphereMeasure N
/-- Theorem 1, eq. (4): the model conditional `q_h(z̃ | z) = C_h(z)^{-1} exp(h(z̃)ᵀ h(z) / τ)`. -/
def sphModelCond {N : ℕ} (τ : ℝ) (h : Vec N → Vec N) (z z' : Vec N) : ℝ :=
Real.exp (inner ℝ (h z') (h z) / τ) / sphModelConst τ h z
/-- Proposition 1: the cross-entropy `H(p(· | z), q_h(· | z)) = E_{p(z̃|z)}[-log q_h(z̃ | z)]` at a
fixed anchor `z`. -/
def sphCondCrossEntropy {N : ℕ} (κ τ : ℝ) (h : Vec N → Vec N) (z : Vec N) : ℝ :=
∫ w : Sph N, vmfCond N κ z w * -Real.log (sphModelCond τ h z w) ∂sphereMeasure N
/-- Theorem 1, eq. (3): the expected cross-entropy `E_{z ∼ p(z)} H(p(· | z), q_h(· | z))`. -/
def sphCrossEntropy {N : ℕ} (κ τ : ℝ) (h : Vec N → Vec N) : ℝ :=
∫ z : Sph N, sphCondCrossEntropy κ τ h z ∂sphereUnif N
/-- Section 3: the law of latent positive pairs `(z, z̃)`, `z ∼ p(z)` uniform and
`z̃ ∼ p(z̃ | z)` von Mises-Fisher; `p_pos` is its image under `g × g`. -/
def sphPosPairLaw (N : ℕ) (κ : ℝ) : Measure (Sph N × Sph N) :=
((sphereUnif N).prod (sphereMeasure N)).withDensity
(fun q => ENNReal.ofReal (vmfCond N κ q.1 q.2))
/-- Eq. (1): the InfoNCE objective `L_contr(f; τ, M)` with `M` negatives, written on latents with
`h = f ∘ g`: `(x, x̃) = (g z, g z̃)` is a positive pair and `x_i^- = g z_i^-` with
`z_i^-` i.i.d. uniform. -/
def infoNCE {N : ℕ} (κ τ : ℝ) (h : Vec N → Vec N) (M : ℕ) : ℝ :=
∫ w : (Sph N × Sph N) × (Fin M → Sph N),
-Real.log (Real.exp (inner ℝ (h w.1.1) (h w.1.2) / τ) /
(Real.exp (inner ℝ (h w.1.1) (h w.1.2) / τ) +
∑ i, Real.exp (inner ℝ (h w.1.1) (h (w.2 i)) / τ)))
∂(sphPosPairLaw N κ).prod (Measure.pi fun _ : Fin M => sphereUnif N)
/-- Theorems 1-2: the objective minimised "for `M → ∞`",
`lim_{M → ∞} (L_contr(f; τ, M) - log M)`. -/
def infoNCELimit {N : ℕ} (κ τ : ℝ) (h : Vec N → Vec N) : ℝ :=
limUnder atTop (fun M : ℕ => infoNCE κ τ h M - Real.log M)
/-- Section 3.3 and Appendix A.2.1: a convex body in `ℝ^N` (compact, convex, nonempty
interior). -/
def IsConvexBody {N : ℕ} (Z : Set (Vec N)) : Prop :=
Convex ℝ Z ∧ IsCompact Z ∧ (interior Z).Nonempty
/-- Eq. (5): `|Z|`, the Lebesgue volume of the latent space. -/
def bodyVolume {N : ℕ} (Z : Set (Vec N)) : ℝ := (volume Z).toReal
/-- Eq. (5): the uniform marginal `p(z) = |Z|^{-1}` on `Z`, as a measure on `ℝ^N`. -/
def bodyUnif {N : ℕ} (Z : Set (Vec N)) : Measure (Vec N) := (volume Z)⁻¹ • volume.restrict Z
/-- Eq. (5): `ν` is a norm on `ℝ^N` (not necessarily the Euclidean one). -/
structure IsNormFn {N : ℕ} (ν : Vec N → ℝ) : Prop where
eq_zero_iff : ∀ x, ν x = 0 ↔ x = 0
smul : ∀ (c : ℝ) (x : Vec N), ν (c • x) = |c| * ν x
add_le : ∀ x y, ν (x + y) ≤ ν x + ν y
/-- Appendix A.2.1 and Lemma 1: `j : ℝ≥0 → ℝ≥0` is a continuous bijection with `j(0) = 0`
(a "continuously invertible map"); values of `j` off `[0, ∞)` are irrelevant. -/
def IsReparam (j : ℝ → ℝ) : Prop :=
Set.BijOn j (Set.Ici 0) (Set.Ici 0) ∧ ContinuousOn j (Set.Ici 0) ∧ j 0 = 0
/-- Eq. (5), Appendix A.2.1 and Lemma 1: `δ` is a metric induced by a norm, `δ(a, b) = ν(a - b)`,
or a semi-metric `δ = j ∘ δ'` of such a metric (`j = id` gives the metric case). -/
def IsNormSemimetric {N : ℕ} (δ : Vec N → Vec N → ℝ) : Prop :=
∃ (ν : Vec N → ℝ) (j : ℝ → ℝ), IsNormFn ν ∧ IsReparam j ∧ ∀ a b, δ a b = j (ν (a - b))
/-- Theorem 6: the `L^α` metric `δ(a, b) = (∑_i |a_i - b_i|^α)^{1/α}`. -/
def lpDist {N : ℕ} (α : ℝ) (a b : Vec N) : ℝ := (∑ i, |a i - b i| ^ α) ^ (1 / α)
/-- Appendix A.2.1: the normalising constant `C_p(z) = ∫_Z exp(-λ δ(z, z̃)) dz̃`. -/
def expConst {N : ℕ} (lam : ℝ) (δ : Vec N → Vec N → ℝ) (Z : Set (Vec N)) (z : Vec N) : ℝ :=
∫ w in Z, Real.exp (-lam * δ z w)
/-- Eq. (5) and Appendix A.2.1: the ground-truth conditional
`p(z̃ | z) = C_p(z)^{-1} exp(-λ δ(z̃, z))` on `Z` (eq. (5) is the case `λ = 1`). -/
def expCond {N : ℕ} (lam : ℝ) (δ : Vec N → Vec N → ℝ) (Z : Set (Vec N)) (z z' : Vec N) : ℝ :=
Real.exp (-lam * δ z' z) / expConst lam δ Z z
/-- Eq. (7) and Theorem 3: `C_h(z) = ∫_Z exp(-δ(h(z̃), h(z)) / τ) dz̃`. -/
def bodyModelConst {N : ℕ} (τ : ℝ) (δ : Vec N → Vec N → ℝ) (Z : Set (Vec N))
(h : Vec N → Vec N) (z : Vec N) : ℝ :=
∫ w in Z, Real.exp (-δ (h w) (h z) / τ)
/-- Eq. (7) and Theorem 3: the model conditional
`q_h(z̃ | z) = C_h(z)^{-1} exp(-δ(h(z̃), h(z)) / τ)`. -/
def bodyModelCond {N : ℕ} (τ : ℝ) (δ : Vec N → Vec N → ℝ) (Z : Set (Vec N))
(h : Vec N → Vec N) (z z' : Vec N) : ℝ :=
Real.exp (-δ (h z') (h z) / τ) / bodyModelConst τ δ Z h z
/-- Proposition 4: `H(p(· | z), q_h(· | z)) = E_{p(z̃|z)}[-log q_h(z̃ | z)]` at a fixed anchor `z`;
`p` uses `(λ, δp)` and `q_h` uses `(τ, δ)`. -/
def bodyCondCrossEntropy {N : ℕ} (lam : ℝ) (δp : Vec N → Vec N → ℝ) (τ : ℝ)
(δ : Vec N → Vec N → ℝ) (Z : Set (Vec N)) (h : Vec N → Vec N) (z : Vec N) : ℝ :=
∫ w in Z, expCond lam δp Z z w * -Real.log (bodyModelCond τ δ Z h z w)
/-- Theorems 3-4: the expected cross-entropy `E_{z ∼ p(z)} H(p(· | z), q_h(· | z))`. -/
def bodyCrossEntropy {N : ℕ} (lam : ℝ) (δp : Vec N → Vec N → ℝ) (τ : ℝ)
(δ : Vec N → Vec N → ℝ) (Z : Set (Vec N)) (h : Vec N → Vec N) : ℝ :=
∫ z, bodyCondCrossEntropy lam δp τ δ Z h z ∂bodyUnif Z
/-- Appendix A.2.1: the law of latent positive pairs `(z, z̃)`, `z ∼ p(z)` uniform on `Z` and
`z̃ ∼ p(z̃ | z)`. -/
def bodyPosPairLaw {N : ℕ} (lam : ℝ) (δp : Vec N → Vec N → ℝ) (Z : Set (Vec N)) :
Measure (Vec N × Vec N) :=
((bodyUnif Z).prod (volume.restrict Z)).withDensity
(fun q => ENNReal.ofReal (expCond lam δp Z q.1 q.2))
/-- Definition 1, eq. (6): the general InfoNCE objective `L_δ-contr(f; τ, M)` with similarity
measure `δ`, written on latents with `h = f ∘ g`; positive pairs come from `p` with `(λ, δp)` and
the `M` negatives are i.i.d. uniform on `Z`. -/
def deltaInfoNCE {N : ℕ} (lam : ℝ) (δp : Vec N → Vec N → ℝ) (τ : ℝ) (δ : Vec N → Vec N → ℝ)
(Z : Set (Vec N)) (h : Vec N → Vec N) (M : ℕ) : ℝ :=
∫ w : (Vec N × Vec N) × (Fin M → Vec N),
-Real.log (Real.exp (-δ (h w.1.1) (h w.1.2) / τ) /
(Real.exp (-δ (h w.1.1) (h w.1.2) / τ) + ∑ i, Real.exp (-δ (h w.1.1) (h (w.2 i)) / τ)))
∂(bodyPosPairLaw lam δp Z).prod (Measure.pi fun _ : Fin M => bodyUnif Z)
/-- Theorems 5-6: the objective minimised "for `M → ∞`",
`lim_{M → ∞} (L_δ-contr(f; τ, M) - log M)`. -/
def deltaInfoNCELimit {N : ℕ} (lam : ℝ) (δp : Vec N → Vec N → ℝ) (τ : ℝ)
(δ : Vec N → Vec N → ℝ) (Z : Set (Vec N)) (h : Vec N → Vec N) : ℝ :=
limUnder atTop (fun M : ℕ => deltaInfoNCE lam δp τ δ Z h M - Real.log M)
/-- Proposition 3: the alignment loss `L_δ-align(f; τ) = τ^{-1} E_{z ∼ p(z), z̃ ∼ p(z̃|z)}
δ(h(z̃), h(z))`. -/
def deltaAlign {N : ℕ} (lam : ℝ) (δp : Vec N → Vec N → ℝ) (τ : ℝ) (δ : Vec N → Vec N → ℝ)
(Z : Set (Vec N)) (h : Vec N → Vec N) : ℝ :=
(1 / τ) * ∫ q, δ (h q.2) (h q.1) ∂bodyPosPairLaw lam δp Z
/-- Proposition 3: the uniformity loss
`L_δ-unif(f; τ) = E_{z ∼ p(z)} log E_{z̃ ∼ p(z̃)} exp(-δ(h(z̃), h(z)) / τ)`, where `p(z̃)` is the
uniform marginal. -/
def deltaUnif {N : ℕ} (τ : ℝ) (δ : Vec N → Vec N → ℝ) (Z : Set (Vec N)) (h : Vec N → Vec N) :
ℝ :=
∫ z, Real.log (∫ w, Real.exp (-δ (h w) (h z) / τ) ∂bodyUnif Z) ∂bodyUnif Z
end ContrastiveInverts
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Conventions used in every item below. Unless stated otherwise:
- is any natural number, including .
- carries its Euclidean inner product and Lebesgue measure .
- Every integral is a real-valued (Bochner) integral, which is defined to be whenever the integrand is not integrable. This includes when the integrand is not measurable.
- is the real logarithm extended by and for .
- Division by zero returns , so , and in particular .
- Measure-valued quantities that are converted to real numbers send to .
- Functions written are completely arbitrary. No measurability, continuity or injectivity is assumed.
- Real parameters are arbitrary real numbers. They may be zero or negative.
Vec. For a natural number , is the space of real -tuples, equipped with the Euclidean inner product , the Euclidean norm, and the standard Lebesgue measure. For it is the one-point space .
Sph. For a natural number , is the unit sphere
in Euclidean norm, regarded as a space of its own whose points are unit vectors. For this set is empty. For it is the two-point set .
sphereMeasure. For a natural number , is the measure on induced by Lebesgue measure on as follows. For a measurable set ,
that is, times the volume of the open radial cone of radius over .
- For this coincides with the standard surface-area measure on . For it is counting measure on .
- For it is the zero measure on the empty sphere.
sphereArea. For a natural number , is the total mass of the measure (defined as times the Lebesgue volume of the radial cone over the set) on the unit sphere, as a real number.
- It equals the usual surface area for . For it equals .
- It equals for .
sphereUnif. For a natural number , is the measure on the unit sphere given by
where is the surface measure.
- For this is the uniform probability measure on the sphere.
- For the sphere is empty and is the zero measure.
vmfConst. For a natural number , a real number (any sign, including ), and an arbitrary vector (not required to be a unit vector),
Here is the surface measure on the unit sphere, defined by .
- The integrand is continuous and bounded on the compact sphere, so the integral is a genuine positive number for .
- For it is .
- No claim is made that it is independent of .
vmfCond. For a natural number , a real , and arbitrary vectors (neither required to lie on the sphere),
where is the surface measure on the unit sphere .
- For the denominator is , so the value is .
- For the value is .
sphModelConst. For a natural number , a real (any value, including or negative), an arbitrary function , and an arbitrary vector ,
with the surface measure on the unit sphere.
- is not assumed measurable or bounded. If the integrand is not integrable, the value is .
- If , the exponent is and .
- For the value is .
sphModelCond. For a natural number , a real , an arbitrary function , and arbitrary vectors ,
where is the surface measure on the unit sphere.
- If , which happens if the integral is non-integrable or , then .
- If , then .
sphCondCrossEntropy. For a natural number , reals , an arbitrary function , and an arbitrary vector ,
The ingredients are:
- is the surface measure on the unit sphere.
- .
- .
Edge cases:
- If (zero denominator), then is used.
- If the integrand is not integrable, the value is .
- For the value is .
sphCrossEntropy. For a natural number , reals , and an arbitrary function ,
where:
- is the normalized surface measure on the unit sphere.
- .
- .
- , with both normalizing integrals taken over the sphere.
Edge cases:
- If the outer or an inner integrand is not integrable, that integral is .
- For everything is .
sphPosPairLaw. For a natural number and a real , is the measure on pairs given by
In words, it has density with respect to the product of:
- the normalized surface measure in the first coordinate, and
- the unnormalized surface measure in the second coordinate.
Here . Negative density values would be truncated to , but this density is nonnegative. For it is the zero measure.
infoNCE. For a natural number , reals , an arbitrary function , and a natural number (including ), write . Then
The measure is as follows:
- is distributed according to , with density with respect to .
- are independent, each with the normalized surface measure on .
The scores are as follows:
- The first coordinate of the pair is the anchor: the positive score is , and each negative score is .
Edge cases:
- If , the sum is empty, the ratio is , and the value is .
- If , every score is , and the integrand is .
- If the integrand is not integrable, the value is .
infoNCELimit. For a natural number , reals , and an arbitrary function ,
where is the expectation, over and independent uniform negatives , of
with all conventions of the infoNCE item.
- The limit is over natural numbers , with the term at using .
- If the sequence has no finite limit, whether because it oscillates or diverges to , the value is an unspecified real number about which nothing is asserted.
IsConvexBody. For a natural number and a set , " is a convex body" means all three of the following hold:
- is convex.
- is compact.
- The interior of is nonempty.
For the only such set is , whose interior in the one-point space is itself.
bodyVolume. For a natural number and an arbitrary set , is the Lebesgue (outer) measure of as a real number.
- is not required to be a convex body or measurable.
- If , the value is .
bodyUnif. For a natural number and an arbitrary set , is the measure on all of given by
This is Lebesgue measure restricted to , scaled by .
- If , it is the uniform probability measure on .
- If or , it is the zero measure.
- is not required to be a convex body.
IsNormFn. For a natural number and a function , " is a norm" means all three of the following hold:
- if and only if .
- for every real and every .
- for all .
Nonnegativity is not stated but follows. The norm need not be the Euclidean one.
IsReparam. For a function , " is a reparametrization" means all three of the following hold:
- maps into , is injective on , and its image of is all of .
- is continuous on .
- .
The values of on negative arguments are unconstrained.
IsNormSemimetric. For a natural number and a function , " is a norm-induced semimetric" means there exist a function and a function such that all three of the following hold:
- is a norm, meaning , , and .
- maps bijectively onto , is continuous there, and satisfies .
- for all .
Consequences of this definition:
- is translation-invariant.
- is symmetric.
- , with equality exactly when .
- Taking to be the identity gives the norm metrics themselves.
lpDist. For a natural number , a real (unconstrained), and vectors ,
using real powers of nonnegative numbers with the conventions and for .
- No restriction such as is imposed.
- For : each term is , and the exponent is , so for all , including .
- For : coordinates where contribute .
- For : the value is when , and when .
expConst. For a natural number , a real (any sign), an arbitrary function , an arbitrary set , and an arbitrary vector (not required to lie in ),
where the integral is with respect to Lebesgue measure restricted to , unnormalized.
- Note the argument order: , with the anchor first.
- is not assumed to be a semimetric. is not assumed to be a convex body.
- If the integrand is not integrable, the value is .
expCond. For a natural number , a real , an arbitrary function , an arbitrary set , and arbitrary vectors ,
The integral is with respect to Lebesgue measure on .
- The numerator evaluates at , while the normalizer evaluates it at . These orders differ, which matters only when is not symmetric.
- is not required to lie in . The formula is not set to zero outside .
- If the denominator is , the value is .
- is not assumed to be a semimetric. is not assumed to be a convex body.
bodyModelConst. For a natural number , a real , an arbitrary function , an arbitrary set , an arbitrary function , and a vector ,
where the integral is with respect to Lebesgue measure on .
- If , the integrand is and the value is when that is finite.
- If the integrand is not integrable, the value is .
bodyModelCond. For a natural number , a real , an arbitrary function , an arbitrary set , an arbitrary function , and vectors ,
- The integral is with respect to Lebesgue measure on .
- In both places is evaluated with the anchor's image second.
- If the denominator is , the value is .
bodyCondCrossEntropy. For a natural number , reals , two arbitrary functions , an arbitrary set , an arbitrary function , and a vector ,
The integral is with respect to Lebesgue measure on , with:
- , built from and .
- , built from and .
The two functions and are independent and not required to be equal or semimetrics.
Edge cases:
- If , then is used.
- If the integrand is not integrable, the value is .
bodyCrossEntropy. For a natural number , reals , arbitrary functions on , an arbitrary set , and an arbitrary function ,
where:
- . This is the zero measure if .
- .
- .
- .
If the outer or an inner integrand is not integrable, that integral is .
bodyPosPairLaw. For a natural number , a real , an arbitrary function on , and an arbitrary set , is the measure on defined by
where:
- is the normalized measure on , used in the first coordinate.
- is unnormalized Lebesgue measure on , used in the second coordinate.
- . This is nonnegative, so the truncation at has no effect.
deltaInfoNCE. For a natural number , reals , arbitrary functions on , an arbitrary set , an arbitrary function , and a natural number (including ), write . Then
The measure is as follows:
- is distributed according to , with density with respect to .
- are independent with law .
The scores are as follows:
- The anchor is the first coordinate , and is evaluated as and , with the anchor first.
- This is the opposite order to the model conditional in the
bodyModelConditem, which evaluates .
Edge cases:
- If , the value is .
- If , the integrand is .
- If the integrand is not integrable, the value is .
- If , all measures involved are zero and the value is .
deltaInfoNCELimit. For a natural number , reals , arbitrary functions , an arbitrary set , and an arbitrary function ,
where is the expectation, over and independent negatives , of
with all conventions of the deltaInfoNCE item.
- The limit is along natural numbers , with at .
- If no finite limit exists, the value is an unspecified real number about which nothing is asserted.
deltaAlign. For a natural number , reals , arbitrary functions on , an arbitrary set , and an arbitrary function ,
Here has density with respect to , where is Lebesgue measure on normalized by .
- If , the value is , because .
- If the integrand is not integrable, the value is .
deltaUnif. For a natural number , a real , an arbitrary function on , an arbitrary set , and an arbitrary function ,
where is the normalized measure on , used for both the inner and outer integrals.
- This measure is zero if , in which case the value is .
- If the inner integral is , which includes the case where it is not integrable, then is used.
- If the outer integrand is not integrable, the value is .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.