Skip to main content

Cosine

Struct Cosine 

Source
pub struct Cosine {}
Expand description

Compute the cosine similarity between two vectors.

Trait Implementations§

Source§

impl Clone for Cosine

Source§

fn clone(&self) -> Cosine

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Cosine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Cosine

Source§

fn default() -> Cosine

Returns the “default value” for a type. Read more
Source§

impl<A, T, L, R> FTarget2<A, T, L, R> for Cosine
where A: Architecture, L: ToSlice, R: ToSlice, Self: Target2<A, T, L, R>,

Source§

fn run(arch: A, left: L, right: R) -> T

Source§

impl PureDistanceFunction<&[f16], &[f16]> for Cosine

Source§

fn evaluate(x: &[Half], y: &[Half]) -> f32

Source§

impl PureDistanceFunction<&[f16], &[f16], MathematicalValue<f32>> for Cosine

Source§

impl PureDistanceFunction<&[f16], &[f16], SimilarityScore<f32>> for Cosine

Source§

impl<const N: usize> PureDistanceFunction<&[f16; N], &[f16; N]> for Cosine

Source§

fn evaluate(x: &[Half; N], y: &[Half; N]) -> f32

Source§

impl<const N: usize> PureDistanceFunction<&[f16; N], &[f16; N], MathematicalValue<f32>> for Cosine

Source§

impl<const N: usize> PureDistanceFunction<&[f16; N], &[f16; N], SimilarityScore<f32>> for Cosine

Source§

impl PureDistanceFunction<&[f32], &[f16]> for Cosine

Source§

fn evaluate(x: &[f32], y: &[Half]) -> f32

Source§

impl PureDistanceFunction<&[f32], &[f16], MathematicalValue<f32>> for Cosine

Source§

impl PureDistanceFunction<&[f32], &[f16], SimilarityScore<f32>> for Cosine

Source§

impl PureDistanceFunction<&[f32], &[f32]> for Cosine

Source§

fn evaluate(x: &[f32], y: &[f32]) -> f32

Source§

impl PureDistanceFunction<&[f32], &[f32], MathematicalValue<f32>> for Cosine

Source§

impl PureDistanceFunction<&[f32], &[f32], SimilarityScore<f32>> for Cosine

Source§

impl<const N: usize> PureDistanceFunction<&[f32; N], &[f16; N]> for Cosine

Source§

fn evaluate(x: &[f32; N], y: &[Half; N]) -> f32

Source§

impl<const N: usize> PureDistanceFunction<&[f32; N], &[f16; N], MathematicalValue<f32>> for Cosine

Source§

impl<const N: usize> PureDistanceFunction<&[f32; N], &[f16; N], SimilarityScore<f32>> for Cosine

Source§

fn evaluate(x: &[f32; N], y: &[Half; N]) -> SimilarityScore<f32>

Source§

impl<const N: usize> PureDistanceFunction<&[f32; N], &[f32; N]> for Cosine

Source§

fn evaluate(x: &[f32; N], y: &[f32; N]) -> f32

Source§

impl<const N: usize> PureDistanceFunction<&[f32; N], &[f32; N], MathematicalValue<f32>> for Cosine

Source§

impl<const N: usize> PureDistanceFunction<&[f32; N], &[f32; N], SimilarityScore<f32>> for Cosine

Source§

fn evaluate(x: &[f32; N], y: &[f32; N]) -> SimilarityScore<f32>

Source§

impl PureDistanceFunction<&[i8], &[i8]> for Cosine

Source§

fn evaluate(x: &[i8], y: &[i8]) -> f32

Source§

impl PureDistanceFunction<&[i8], &[i8], MathematicalValue<f32>> for Cosine

Source§

impl PureDistanceFunction<&[i8], &[i8], SimilarityScore<f32>> for Cosine

Source§

impl<const N: usize> PureDistanceFunction<&[i8; N], &[i8; N]> for Cosine

Source§

fn evaluate(x: &[i8; N], y: &[i8; N]) -> f32

Source§

impl<const N: usize> PureDistanceFunction<&[i8; N], &[i8; N], MathematicalValue<f32>> for Cosine

Source§

fn evaluate(x: &[i8; N], y: &[i8; N]) -> MathematicalValue<f32>

Source§

impl<const N: usize> PureDistanceFunction<&[i8; N], &[i8; N], SimilarityScore<f32>> for Cosine

Source§

fn evaluate(x: &[i8; N], y: &[i8; N]) -> SimilarityScore<f32>

Source§

impl PureDistanceFunction<&[u8], &[u8]> for Cosine

Source§

fn evaluate(x: &[u8], y: &[u8]) -> f32

Source§

impl PureDistanceFunction<&[u8], &[u8], MathematicalValue<f32>> for Cosine

Source§

impl PureDistanceFunction<&[u8], &[u8], SimilarityScore<f32>> for Cosine

Source§

impl<const N: usize> PureDistanceFunction<&[u8; N], &[u8; N]> for Cosine

Source§

fn evaluate(x: &[u8; N], y: &[u8; N]) -> f32

Source§

impl<const N: usize> PureDistanceFunction<&[u8; N], &[u8; N], MathematicalValue<f32>> for Cosine

Source§

fn evaluate(x: &[u8; N], y: &[u8; N]) -> MathematicalValue<f32>

Source§

impl<const N: usize> PureDistanceFunction<&[u8; N], &[u8; N], SimilarityScore<f32>> for Cosine

Source§

fn evaluate(x: &[u8; N], y: &[u8; N]) -> SimilarityScore<f32>

Source§

impl<A, T, L, R> Target2<A, T, L, R> for Cosine
where A: Architecture, L: ToSlice, R: ToSlice, CosineStateless: SIMDSchema<L::Target, R::Target, A>, Self: PostOp<<CosineStateless as SIMDSchema<L::Target, R::Target, A>>::Return, T>,

Source§

fn run(self, arch: A, left: L, right: R) -> T

Run the operation with the provided Architecture.
Source§

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 UnwindSafe for Cosine

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.