1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
mod linear;
mod poly;
mod rbf;
mod sigmoid;
use crate::{
f32s,
sparse::{SparseMatrix, SparseVector},
};
use simd_aligned::{MatrixD, Rows, VectorD};
pub use self::{linear::*, poly::*, rbf::*, sigmoid::*};
#[doc(hidden)]
pub trait KernelDense
where
Self: Sync,
{
fn compute(&self, vectors: &MatrixD<f32s, Rows>, feature: &VectorD<f32s>, output: &mut [f64]);
}
#[doc(hidden)]
pub trait KernelSparse
where
Self: Sync,
{
fn compute(&self, vectors: &SparseMatrix<f32>, feature: &SparseVector<f32>, output: &mut [f64]);
}