pub struct CompensatedSquaredL2 { /* private fields */ }Expand description
A DistanceFunction containing scaling parameters to enable distance the SquaredL2
distance function over CompensatedVectors belonging to the same quantization space.
Implementations§
Trait Implementations§
Source§impl<A> AsFunctor<CompensatedSquaredL2> for SphericalQuantizer<A>where
A: Allocator,
impl<A> AsFunctor<CompensatedSquaredL2> for SphericalQuantizer<A>where
A: Allocator,
fn as_functor(&self) -> CompensatedSquaredL2
Source§impl Clone for CompensatedSquaredL2
impl Clone for CompensatedSquaredL2
Source§fn clone(&self) -> CompensatedSquaredL2
fn clone(&self) -> CompensatedSquaredL2
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompensatedSquaredL2
impl Debug for CompensatedSquaredL2
Source§impl<A, const NBITS: usize> Target2<A, Result<MathematicalValue<f32>, UnequalLengths>, Slice<&[f32], Ref<'_, FullQueryMeta>>, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, DataMeta>>> for CompensatedSquaredL2where
A: Architecture,
Unsigned: Representation<NBITS>,
InnerProduct: for<'a> Target2<A, MathematicalResult<f32>, &'a [f32], BitSlice<'a, NBITS, Unsigned>>,
Compute the inner product between a full-precision query and a spherically quantized
data vector.
impl<A, const NBITS: usize> Target2<A, Result<MathematicalValue<f32>, UnequalLengths>, Slice<&[f32], Ref<'_, FullQueryMeta>>, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, DataMeta>>> for CompensatedSquaredL2where
A: Architecture,
Unsigned: Representation<NBITS>,
InnerProduct: for<'a> Target2<A, MathematicalResult<f32>, &'a [f32], BitSlice<'a, NBITS, Unsigned>>,
Compute the inner product between a full-precision query and a spherically quantized data vector.
Returns an error if the arguments have different lengths.
Source§fn run(
self,
arch: A,
x: FullQueryRef<'_>,
y: DataRef<'_, NBITS>,
) -> MathematicalResult<f32>
fn run( self, arch: A, x: FullQueryRef<'_>, y: DataRef<'_, NBITS>, ) -> MathematicalResult<f32>
Architecture.Source§impl<A, const NBITS: usize> Target2<A, Result<MathematicalValue<f32>, UnequalLengths>, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, DataMeta>>, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, DataMeta>>> for CompensatedSquaredL2where
A: Architecture,
Unsigned: Representation<NBITS>,
InnerProduct: for<'a> Target2<A, MathematicalResult<u32>, BitSlice<'a, NBITS, Unsigned>, BitSlice<'a, NBITS, Unsigned>>,
Compute the squared euclidean distance between the two compensated vectors.
impl<A, const NBITS: usize> Target2<A, Result<MathematicalValue<f32>, UnequalLengths>, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, DataMeta>>, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, DataMeta>>> for CompensatedSquaredL2where
A: Architecture,
Unsigned: Representation<NBITS>,
InnerProduct: for<'a> Target2<A, MathematicalResult<u32>, BitSlice<'a, NBITS, Unsigned>, BitSlice<'a, NBITS, Unsigned>>,
Compute the squared euclidean distance between the two compensated vectors.
The value returned by this function is scaled properly, meaning that distances returned by this method are compatible with full-precision distances.
§Validity
The results of this function are only meaningful if both x, y, and Self belong to
the same quantizer.
Source§impl<A, const Q: usize, const D: usize, Perm> Target2<A, Result<MathematicalValue<f32>, UnequalLengths>, VectorBase<Q, Unsigned, SlicePtr<'_, u8>, Ref<'_, QueryMeta>, Perm>, VectorBase<D, Unsigned, SlicePtr<'_, u8>, Ref<'_, DataMeta>>> for CompensatedSquaredL2where
A: Architecture,
Unsigned: Representation<Q> + Representation<D>,
Perm: PermutationStrategy<Q>,
for<'a> InnerProduct: Target2<A, MathematicalResult<u32>, BitSlice<'a, Q, Unsigned, Perm>, BitSlice<'a, D, Unsigned>>,
impl<A, const Q: usize, const D: usize, Perm> Target2<A, Result<MathematicalValue<f32>, UnequalLengths>, VectorBase<Q, Unsigned, SlicePtr<'_, u8>, Ref<'_, QueryMeta>, Perm>, VectorBase<D, Unsigned, SlicePtr<'_, u8>, Ref<'_, DataMeta>>> for CompensatedSquaredL2where
A: Architecture,
Unsigned: Representation<Q> + Representation<D>,
Perm: PermutationStrategy<Q>,
for<'a> InnerProduct: Target2<A, MathematicalResult<u32>, BitSlice<'a, Q, Unsigned, Perm>, BitSlice<'a, D, Unsigned>>,
Source§impl<A, T, U> Target2<A, Result<f32, UnequalLengths>, T, U> for CompensatedSquaredL2
A blanket implementation for applying the identity transformation from
MathematicalValue to f32 for Euclidean distance computations.
impl<A, T, U> Target2<A, Result<f32, UnequalLengths>, T, U> for CompensatedSquaredL2
A blanket implementation for applying the identity transformation from
MathematicalValue to f32 for Euclidean distance computations.
impl Copy for CompensatedSquaredL2
Auto Trait Implementations§
impl Freeze for CompensatedSquaredL2
impl RefUnwindSafe for CompensatedSquaredL2
impl Send for CompensatedSquaredL2
impl Sync for CompensatedSquaredL2
impl Unpin for CompensatedSquaredL2
impl UnwindSafe for CompensatedSquaredL2
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