pub enum Map0132 {
Identity,
Linear {
max: f32,
},
IncSigmoid {
low: f32,
high: f32,
},
DecSigmoid {
low: f32,
high: f32,
},
Cauchy {
center: f32,
half_left: f32,
half_right: f32,
},
Custom(fn(f32) -> f32),
}Expand description
Normalization strategy that maps a raw measure to [0, 1].
All variants except Custom guarantee the output is in
[0, 1] by construction. Custom is validated at evaluation time via
Value01::witness.
Variants§
Identity
Clamp raw to [0, 1].
Linear
raw / max, clamped to [0, 1].
IncSigmoid
Increasing sigmoid: low → ≈0, high → ≈1.
Steepness is auto-calibrated: k = 2·ln(1/ε − 1) / (high − low) where
ε = 10·f32::EPSILON. At raw = low output ≈ ε, at raw = high ≈ 1−ε.
DecSigmoid
Decreasing sigmoid: low → ≈1, high → ≈0.
Same auto-calibrated steepness as IncSigmoid,
with the sign of k flipped. At raw = low output ≈ 1−ε, at
raw = high ≈ ε.
Cauchy
Asymmetric Cauchy (Lorentzian) with independent left/right half-widths.
Peaks at center with value 1. The half-width at half-maximum is
half_left for raw < center and half_right for raw >= center.
When half_left == half_right this is the classic symmetric Cauchy.
Fields
Custom(fn(f32) -> f32)
User-provided normalization function.
The function receives the raw measure value and must return a value in
[0, 1]. The output is validated at evaluation time.