pub struct CompensatedIP { /* 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<CompensatedIP> for SphericalQuantizer<A>where
A: Allocator,
impl<A> AsFunctor<CompensatedIP> for SphericalQuantizer<A>where
A: Allocator,
fn as_functor(&self) -> CompensatedIP
Source§impl Clone for CompensatedIP
impl Clone for CompensatedIP
Source§fn clone(&self) -> CompensatedIP
fn clone(&self) -> CompensatedIP
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompensatedIP
impl Debug for CompensatedIP
Source§impl<A, const NBITS: usize> Target2<A, Result<MathematicalValue<f32>, UnequalLengths>, Slice<&[f32], Ref<'_, FullQueryMeta>>, VectorBase<NBITS, Unsigned, SlicePtr<'_, u8>, Ref<'_, DataMeta>>> for CompensatedIPwhere
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 CompensatedIPwhere
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 CompensatedIPwhere
A: Architecture,
Unsigned: Representation<NBITS>,
InnerProduct: for<'a> Target2<A, MathematicalResult<u32>, BitSlice<'a, NBITS, Unsigned>, BitSlice<'a, NBITS, Unsigned>>,
Compute the inner product 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 CompensatedIPwhere
A: Architecture,
Unsigned: Representation<NBITS>,
InnerProduct: for<'a> Target2<A, MathematicalResult<u32>, BitSlice<'a, NBITS, Unsigned>, BitSlice<'a, NBITS, Unsigned>>,
Compute the inner product between the two compensated vectors.
Returns an error if the arguments have different lengths.
The value returned by this function is scaled properly, meaning that distances returned by this method are compatible with full-precision computations.
§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 CompensatedIPwhere
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 CompensatedIPwhere
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 CompensatedIP
A blanket implementation for applying the negating transformation
impl<A, T, U> Target2<A, Result<f32, UnequalLengths>, T, U> for CompensatedIP
A blanket implementation for applying the negating transformation
x -> -xfrom MathematicalValue to f32 for inner product distance computations.
impl Copy for CompensatedIP
Auto Trait Implementations§
impl Freeze for CompensatedIP
impl RefUnwindSafe for CompensatedIP
impl Send for CompensatedIP
impl Sync for CompensatedIP
impl Unpin for CompensatedIP
impl UnwindSafe for CompensatedIP
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