pub struct MMLPathValidator {
pub compression_level: u32,
}Expand description
Validates a tensor transformation using Minimum Message Length (Kolmogorov) principles.
The MML score measures how well the output compresses relative to the input.
A lower score means the transformation found a more optimal encoding path.
The proof is valid only if mml_score <= mml_threshold.
Fields§
§compression_level: u32Implementations§
Source§impl MMLPathValidator
impl MMLPathValidator
Sourcepub fn compute_mml_score(
&self,
input: &Tensor,
output: &Tensor,
) -> Result<f64, TribeError>
pub fn compute_mml_score( &self, input: &Tensor, output: &Tensor, ) -> Result<f64, TribeError>
Compute the MML score: ratio of compressed output length to compressed input length. Score < 1.0 means the transformation produced a more compressible result.
Sourcepub fn compute_entropy_mml_score(&self, input: &Tensor, output: &Tensor) -> f64
pub fn compute_entropy_mml_score(&self, input: &Tensor, output: &Tensor) -> f64
Compute an MML-like score using the same byte-level entropy approximation implemented on ESP firmware. This does NOT use DEFLATE and is intended for calibration and comparison only.
Score is defined as: output_entropy / input_entropy, where entropy is Shannon entropy over the raw little-endian bytes of the tensor data.
Sourcepub fn validate(&self, mml_score: f64, mml_threshold: f64) -> bool
pub fn validate(&self, mml_score: f64, mml_threshold: f64) -> bool
Check whether an MML score passes the threshold for a given difficulty.
Sourcepub fn threshold_for_difficulty(base_threshold: f64, difficulty: u64) -> f64
pub fn threshold_for_difficulty(base_threshold: f64, difficulty: u64) -> f64
Compute the MML threshold for a given difficulty level. Tighter (lower) thresholds at higher difficulties.
Trait Implementations§
Source§impl Default for MMLPathValidator
impl Default for MMLPathValidator
Source§fn default() -> MMLPathValidator
fn default() -> MMLPathValidator
Auto Trait Implementations§
impl Freeze for MMLPathValidator
impl RefUnwindSafe for MMLPathValidator
impl Send for MMLPathValidator
impl Sync for MMLPathValidator
impl Unpin for MMLPathValidator
impl UnsafeUnpin for MMLPathValidator
impl UnwindSafe for MMLPathValidator
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more