pub struct ArdRbfKernel { /* private fields */ }Expand description
ARD (Automatic Relevance Determination) RBF kernel.
K(x, y) = σ² * exp(-0.5 * Σ((x_i - y_i)² / l_i²))
Each dimension has its own length scale l_i, allowing the kernel
to automatically weight features by their relevance.
Implementations§
Source§impl ArdRbfKernel
impl ArdRbfKernel
Sourcepub fn with_variance(length_scales: Vec<f64>, variance: f64) -> Result<Self>
pub fn with_variance(length_scales: Vec<f64>, variance: f64) -> Result<Self>
Create ARD RBF kernel with custom signal variance.
§Arguments
length_scales- Per-dimension length scalesvariance- Signal variance (output scale, must be positive)
Sourcepub fn length_scales(&self) -> &[f64]
pub fn length_scales(&self) -> &[f64]
Get the length scales.
Sourcepub fn compute_gradient(&self, x: &[f64], y: &[f64]) -> Result<KernelGradient>
pub fn compute_gradient(&self, x: &[f64], y: &[f64]) -> Result<KernelGradient>
Compute the kernel gradient with respect to hyperparameters.
Returns gradients for:
- Each length scale (one per dimension)
- The signal variance
This is useful for hyperparameter optimization via gradient descent.
Trait Implementations§
Source§impl Clone for ArdRbfKernel
impl Clone for ArdRbfKernel
Source§fn clone(&self) -> ArdRbfKernel
fn clone(&self) -> ArdRbfKernel
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 ArdRbfKernel
impl Debug for ArdRbfKernel
Auto Trait Implementations§
impl Freeze for ArdRbfKernel
impl RefUnwindSafe for ArdRbfKernel
impl Send for ArdRbfKernel
impl Sync for ArdRbfKernel
impl Unpin for ArdRbfKernel
impl UnwindSafe for ArdRbfKernel
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