pub struct Cosine;Expand description
Cosine distance, defined as 1 − cosine_similarity(a, b).
Range is [0, 2]. Returns 1.0 if either vector has zero norm
(chosen over NaN for HNSW compatibility).
Trait Implementations§
Source§impl Metric for Cosine
impl Metric for Cosine
impl Copy for Cosine
Auto Trait Implementations§
impl Freeze for Cosine
impl RefUnwindSafe for Cosine
impl Send for Cosine
impl Sync for Cosine
impl Unpin for Cosine
impl UnsafeUnpin for Cosine
impl UnwindSafe for Cosine
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