pub struct FibConfig {
pub k: u32,
pub n: u32,
pub training_samples: u32,
pub lloyd_restarts: u32,
pub lloyd_iterations: u32,
}Expand description
FibQuant configuration parameters.
Fields§
§k: u32Block dimension k.
n: u32Codebook size N.
training_samples: u32Number of training samples for Lloyd-Max refinement.
lloyd_restarts: u32Number of Lloyd restarts.
lloyd_iterations: u32Number of Lloyd iterations per restart.
Implementations§
Source§impl FibConfig
impl FibConfig
Sourcepub fn default_k4_n32() -> Self
pub fn default_k4_n32() -> Self
The benchmark-proven configuration: k=4, N=32, 50× compression with 100% recall.
Sourcepub fn nominal_compression_ratio(&self) -> f64
pub fn nominal_compression_ratio(&self) -> f64
Expected compression ratio (input f32 bytes / compressed bytes). For k=4, N=32: each block of 4 f32 values (16 bytes) maps to a ceil(log2(32)) = 5-bit index (+norm header), yielding roughly 50:1. Uses fib-quant’s actual nominal_compression_ratio when available.
Sourcepub fn expected_compression_ratio(&self) -> f64
pub fn expected_compression_ratio(&self) -> f64
Expected codebook-based compression ratio (50× target for k=4,N=32).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FibConfig
impl<'de> Deserialize<'de> for FibConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for FibConfig
Auto Trait Implementations§
impl Freeze for FibConfig
impl RefUnwindSafe for FibConfig
impl Send for FibConfig
impl Sync for FibConfig
impl Unpin for FibConfig
impl UnsafeUnpin for FibConfig
impl UnwindSafe for FibConfig
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.