pub struct Chamfer;Expand description
Asymmetric Chamfer distance for multi-vector similarity.
Computes the sum of per-query-vector maximum similarities:
Chamfer(Q, D) = Σᵢ minⱼ -IP(qᵢ, dⱼ)Implements PureDistanceFunction
for matrix view types.
Trait Implementations§
Source§impl<const NBITS: usize> PureDistanceFunction<QueryMatRef<'_, MinMaxMeta<NBITS>>, MatRef<'_, MinMaxMeta<NBITS>>> for Chamferwhere
Unsigned: Representation<NBITS>,
InnerProduct: for<'a, 'b> PureDistanceFunction<BitSlice<'a, NBITS, Unsigned>, BitSlice<'b, NBITS, Unsigned>, MathematicalResult<u32>>,
impl<const NBITS: usize> PureDistanceFunction<QueryMatRef<'_, MinMaxMeta<NBITS>>, MatRef<'_, MinMaxMeta<NBITS>>> for Chamferwhere
Unsigned: Representation<NBITS>,
InnerProduct: for<'a, 'b> PureDistanceFunction<BitSlice<'a, NBITS, Unsigned>, BitSlice<'b, NBITS, Unsigned>, MathematicalResult<u32>>,
fn evaluate( query: QueryMatRef<'_, MinMaxMeta<NBITS>>, doc: MatRef<'_, MinMaxMeta<NBITS>>, ) -> f32
Source§impl<T: Copy> PureDistanceFunction<QueryMatRef<'_, Standard<T>>, MatRef<'_, Standard<T>>> for Chamfer
impl<T: Copy> PureDistanceFunction<QueryMatRef<'_, Standard<T>>, MatRef<'_, Standard<T>>> for Chamfer
impl Copy for Chamfer
Auto Trait Implementations§
impl Freeze for Chamfer
impl RefUnwindSafe for Chamfer
impl Send for Chamfer
impl Sync for Chamfer
impl Unpin for Chamfer
impl UnsafeUnpin for Chamfer
impl UnwindSafe for Chamfer
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<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