pub struct CustomExponentialKernel {
pub length_scale: Float,
}Expand description
Custom exponential kernel (1D version of Laplacian) CustomExponentialKernel
Fields§
§length_scale: Floatlength_scale
Implementations§
Trait Implementations§
Source§impl Clone for CustomExponentialKernel
impl Clone for CustomExponentialKernel
Source§fn clone(&self) -> CustomExponentialKernel
fn clone(&self) -> CustomExponentialKernel
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 CustomExponentialKernel
impl Debug for CustomExponentialKernel
Source§impl KernelFunction for CustomExponentialKernel
impl KernelFunction for CustomExponentialKernel
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 CustomExponentialKernel
impl RefUnwindSafe for CustomExponentialKernel
impl Send for CustomExponentialKernel
impl Sync for CustomExponentialKernel
impl Unpin for CustomExponentialKernel
impl UnwindSafe for CustomExponentialKernel
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