pub enum Metric {
L2,
Cosine,
Ip,
Hamming,
}Expand description
How a vector is compared. Part of the shape because a collection built for cosine and searched as if it were L2 gives wrong answers quietly.
Variants§
L2
Euclidean distance.
Cosine
Cosine similarity.
Ip
Inner product.
Hamming
Hamming distance, for binary vectors.
Implementations§
Trait Implementations§
impl Copy for Metric
impl Eq for Metric
impl StructuralPartialEq for Metric
Auto Trait Implementations§
impl Freeze for Metric
impl RefUnwindSafe for Metric
impl Send for Metric
impl Sync for Metric
impl Unpin for Metric
impl UnsafeUnpin for Metric
impl UnwindSafe for Metric
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