pub struct SimdKernels { /* private fields */ }Expand description
SIMD-optimized kernel implementations
Implementations§
Source§impl SimdKernels
impl SimdKernels
Sourcepub fn new(config: SimdKernelConfig) -> Self
pub fn new(config: SimdKernelConfig) -> Self
Create a new SIMD kernel instance
Sourcepub fn linear_kernel(
&self,
x: &ArrayView1<'_, Float>,
y: &ArrayView1<'_, Float>,
) -> Result<Float>
pub fn linear_kernel( &self, x: &ArrayView1<'_, Float>, y: &ArrayView1<'_, Float>, ) -> Result<Float>
Compute linear kernel with SIMD optimization
Sourcepub fn rbf_kernel(
&self,
x: &ArrayView1<'_, Float>,
y: &ArrayView1<'_, Float>,
gamma: Float,
) -> Result<Float>
pub fn rbf_kernel( &self, x: &ArrayView1<'_, Float>, y: &ArrayView1<'_, Float>, gamma: Float, ) -> Result<Float>
Compute RBF kernel with SIMD optimization
Sourcepub fn polynomial_kernel(
&self,
x: &ArrayView1<'_, Float>,
y: &ArrayView1<'_, Float>,
degree: u32,
gamma: Float,
coef0: Float,
) -> Result<Float>
pub fn polynomial_kernel( &self, x: &ArrayView1<'_, Float>, y: &ArrayView1<'_, Float>, degree: u32, gamma: Float, coef0: Float, ) -> Result<Float>
Compute polynomial kernel with SIMD optimization
Sourcepub fn compute_kernel_matrix(
&self,
x: &Array2<Float>,
y: &Array2<Float>,
kernel_fn: impl Fn(&ArrayView1<'_, Float>, &ArrayView1<'_, Float>) -> Result<Float> + Sync,
) -> Result<Array2<Float>>
pub fn compute_kernel_matrix( &self, x: &Array2<Float>, y: &Array2<Float>, kernel_fn: impl Fn(&ArrayView1<'_, Float>, &ArrayView1<'_, Float>) -> Result<Float> + Sync, ) -> Result<Array2<Float>>
Batch kernel computation with SIMD optimization
Sourcepub fn compute_kernel_diagonal(
&self,
x: &Array2<Float>,
kernel_fn: impl Fn(&ArrayView1<'_, Float>, &ArrayView1<'_, Float>) -> Result<Float>,
) -> Result<Array1<Float>>
pub fn compute_kernel_diagonal( &self, x: &Array2<Float>, kernel_fn: impl Fn(&ArrayView1<'_, Float>, &ArrayView1<'_, Float>) -> Result<Float>, ) -> Result<Array1<Float>>
Compute diagonal of kernel matrix (efficient for RBF and similar kernels)
Sourcepub fn compute_symmetric_kernel_matrix(
&self,
x: &Array2<Float>,
kernel_fn: impl Fn(&ArrayView1<'_, Float>, &ArrayView1<'_, Float>) -> Result<Float> + Sync,
) -> Result<Array2<Float>>
pub fn compute_symmetric_kernel_matrix( &self, x: &Array2<Float>, kernel_fn: impl Fn(&ArrayView1<'_, Float>, &ArrayView1<'_, Float>) -> Result<Float> + Sync, ) -> Result<Array2<Float>>
Optimized kernel computation for symmetric matrices
Auto Trait Implementations§
impl Freeze for SimdKernels
impl RefUnwindSafe for SimdKernels
impl Send for SimdKernels
impl Sync for SimdKernels
impl Unpin for SimdKernels
impl UnsafeUnpin for SimdKernels
impl UnwindSafe for SimdKernels
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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