pub enum TargetDim {
Same,
Natural,
Override(NonZeroUsize),
}Expand description
Transformations possess the ability to keep dimensionality the same, increase it, or decrease it.
This struct enables the caller to communicate the desired behavior upon transform construction.
Variants§
Same
Keep the output dimensionality the same as the input dimensionality.
§Note
When the input dimensionality is less than the “natural” dimensionality (
see Self::Natural, post-transformed sampling may be invoked where only a subset
of the transformed vector’s dimensions are retained.
For low dimensional embeddings, this sampling may result in high norm variance and poor recall.
Natural
Use the “natural” dimensionality for the output.
This allows transformations like PaddingHadamard to increase the dimensionality
to the next power of two if needed. This will usually provide better accuracy than
Self::Same but may result in a worse compression ratio.
Override(NonZeroUsize)
Set a hard value for the output dimensionality.
This may result in arbitrary subsampling (see the note in TargetDim::Same or
supersampling (zero padding the pretransformed vector). Use with care.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TargetDim
impl RefUnwindSafe for TargetDim
impl Send for TargetDim
impl Sync for TargetDim
impl Unpin for TargetDim
impl UnsafeUnpin for TargetDim
impl UnwindSafe for TargetDim
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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