pub struct FibCodebookV1 {
pub schema_version: String,
pub profile: FibQuantProfileV1,
pub profile_digest: String,
pub codebook_digest: String,
pub rotation_digest: String,
pub codewords: Vec<f32>,
pub init_mse: f64,
pub training_mse: f64,
pub refinement_report: LloydReportV1,
}Expand description
Persisted FibQuant codebook in row-major codeword order.
Fields§
§schema_version: StringStable schema marker.
profile: FibQuantProfileV1Profile used to create this codebook.
profile_digest: StringDigest of profile.
codebook_digest: StringDigest of profile, report, and row-major codewords.
rotation_digest: StringDigest of deterministic ambient rotation identity and matrix.
codewords: Vec<f32>Row-major N x k f32 codeword storage.
init_mse: f64Initial codebook training MSE before Lloyd-Max.
training_mse: f64Best training MSE after Lloyd-Max.
refinement_report: LloydReportV1Lloyd-Max refinement receipt.
Implementations§
Source§impl FibCodebookV1
impl FibCodebookV1
Sourcepub fn build(profile: FibQuantProfileV1) -> Result<Self>
pub fn build(profile: FibQuantProfileV1) -> Result<Self>
Build a full refined codebook for a profile.
Sourcepub fn compute_digest(&self) -> Result<String>
pub fn compute_digest(&self) -> Result<String>
Deterministic codebook digest.
Trait Implementations§
Source§impl Clone for FibCodebookV1
impl Clone for FibCodebookV1
Source§fn clone(&self) -> FibCodebookV1
fn clone(&self) -> FibCodebookV1
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FibCodebookV1
impl Debug for FibCodebookV1
Source§impl<'de> Deserialize<'de> for FibCodebookV1
impl<'de> Deserialize<'de> for FibCodebookV1
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
Source§impl PartialEq for FibCodebookV1
impl PartialEq for FibCodebookV1
Source§fn eq(&self, other: &FibCodebookV1) -> bool
fn eq(&self, other: &FibCodebookV1) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for FibCodebookV1
impl Serialize for FibCodebookV1
impl StructuralPartialEq for FibCodebookV1
Auto Trait Implementations§
impl Freeze for FibCodebookV1
impl RefUnwindSafe for FibCodebookV1
impl Send for FibCodebookV1
impl Sync for FibCodebookV1
impl Unpin for FibCodebookV1
impl UnsafeUnpin for FibCodebookV1
impl UnwindSafe for FibCodebookV1
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,
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.