pub struct DifferentialEncoder {
pub config: DimensionalConfig,
pub basis: Vec<HyperVec>,
pub match_threshold: f64,
pub precision_threshold: f64,
}Expand description
Differential encoder using a codebook basis
Fields§
§config: DimensionalConfigConfiguration
basis: Vec<HyperVec>Basis vectors (the codebook)
match_threshold: f64Threshold for considering a match
precision_threshold: f64Threshold for expanding precision
Implementations§
Source§impl DifferentialEncoder
impl DifferentialEncoder
Sourcepub fn new(config: DimensionalConfig) -> Self
pub fn new(config: DimensionalConfig) -> Self
Create a new encoder
Sourcepub fn encode(&self, data: &HyperVec) -> DifferentialEncoding
pub fn encode(&self, data: &HyperVec) -> DifferentialEncoding
Encode data differentially against the codebook
Sourcepub fn decode(&self, encoding: &DifferentialEncoding) -> HyperVec
pub fn decode(&self, encoding: &DifferentialEncoding) -> HyperVec
Full reconstruction from differential encoding
Auto Trait Implementations§
impl Freeze for DifferentialEncoder
impl RefUnwindSafe for DifferentialEncoder
impl Send for DifferentialEncoder
impl Sync for DifferentialEncoder
impl Unpin for DifferentialEncoder
impl UnwindSafe for DifferentialEncoder
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> 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 more