pub struct CustomRBFKernel {
pub gamma: Float,
pub sigma: Float,
}Expand description
Custom RBF kernel with configurable parameters CustomRBFKernel
Fields§
§gamma: Floatgamma
sigma: Floatsigma
Implementations§
Trait Implementations§
Source§impl Clone for CustomRBFKernel
impl Clone for CustomRBFKernel
Source§fn clone(&self) -> CustomRBFKernel
fn clone(&self) -> CustomRBFKernel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CustomRBFKernel
impl Debug for CustomRBFKernel
Source§impl KernelFunction for CustomRBFKernel
impl KernelFunction for CustomRBFKernel
Source§fn kernel(&self, x: &[Float], y: &[Float]) -> Float
fn kernel(&self, x: &[Float], y: &[Float]) -> Float
Compute the kernel value between two vectors
Source§fn fourier_transform(&self, w: &[Float]) -> Float
fn fourier_transform(&self, w: &[Float]) -> Float
Get the characteristic function of the kernel’s Fourier transform
This should return the Fourier transform of the kernel at frequency w
For most kernels, this is needed to generate appropriate random features
Source§fn sample_frequencies(
&self,
n_features: usize,
n_components: usize,
rng: &mut RealStdRng,
) -> Array2<Float>
fn sample_frequencies( &self, n_features: usize, n_components: usize, rng: &mut RealStdRng, ) -> Array2<Float>
Sample random frequencies for Random Fourier Features
This method should sample frequencies according to the spectral measure
of the kernel (i.e., the Fourier transform of the kernel)
Source§fn description(&self) -> String
fn description(&self) -> String
Get a description of the kernel
Auto Trait Implementations§
impl Freeze for CustomRBFKernel
impl RefUnwindSafe for CustomRBFKernel
impl Send for CustomRBFKernel
impl Sync for CustomRBFKernel
impl Unpin for CustomRBFKernel
impl UnwindSafe for CustomRBFKernel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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