pub struct Multiquadric {
pub c: f64,
}Expand description
The Multiquadric Kernel.
k(x,y) = sqrt(||x-y||² + c²)
Fields§
§c: f64Constant added to square of difference.
Implementations§
Source§impl Multiquadric
impl Multiquadric
Sourcepub fn new(c: f64) -> Multiquadric
pub fn new(c: f64) -> Multiquadric
Constructs a new Multiquadric Kernel.
Trait Implementations§
Source§impl Clone for Multiquadric
impl Clone for Multiquadric
Source§fn clone(&self) -> Multiquadric
fn clone(&self) -> Multiquadric
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 Multiquadric
impl Debug for Multiquadric
Source§impl Default for Multiquadric
Constructs a default Multiquadric Kernel.
impl Default for Multiquadric
Constructs a default Multiquadric Kernel.
The defaults are:
- c = 0
Source§fn default() -> Multiquadric
fn default() -> Multiquadric
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Multiquadric
impl<'de> Deserialize<'de> for Multiquadric
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Kernel for Multiquadric
impl Kernel for Multiquadric
Source§fn nb_parameters(&self) -> usize
fn nb_parameters(&self) -> usize
Numbers of parameters (such as bandwidth and amplitude) of the kernel. Read more
Source§fn kernel<S1: Storage<f64, U1, Dyn>, S2: Storage<f64, U1, Dyn>>(
&self,
x1: &SRowVector<S1>,
x2: &SRowVector<S2>,
) -> f64
fn kernel<S1: Storage<f64, U1, Dyn>, S2: Storage<f64, U1, Dyn>>( &self, x1: &SRowVector<S1>, x2: &SRowVector<S2>, ) -> f64
Takes two equal length slices (row vector) and returns a scalar. Read more
Source§fn gradient<S1: Storage<f64, U1, Dyn>, S2: Storage<f64, U1, Dyn>>(
&self,
x1: &SRowVector<S1>,
x2: &SRowVector<S2>,
) -> Vec<f64>
fn gradient<S1: Storage<f64, U1, Dyn>, S2: Storage<f64, U1, Dyn>>( &self, x1: &SRowVector<S1>, x2: &SRowVector<S2>, ) -> Vec<f64>
Takes two equal length slices (row vector) and returns a vector containing the value of the gradient for each parameter in an arbitrary order. Read more
Source§fn get_parameters(&self) -> Vec<f64>
fn get_parameters(&self) -> Vec<f64>
Returns a vector containing all the parameters of the kernel in the same order as the outputs of the
gradient function.Source§fn set_parameters(&mut self, parameters: &[f64])
fn set_parameters(&mut self, parameters: &[f64])
Sets all the parameters of the kernel by reading them from a slice where they are in the same order as the outputs of the
gradient function.Source§fn is_scalable(&self) -> bool
fn is_scalable(&self) -> bool
Source§fn rescale(&mut self, _scale: f64)
fn rescale(&mut self, _scale: f64)
Multiplies the amplitude of the kernel by the
scale parameter such that a kernel a*K(x,y) becomes scale*a*K(x,y). Read moreSource§fn heuristic_fit<SM: Storage<f64, Dyn, Dyn>, SV: Storage<f64, Dyn, U1>>(
&mut self,
_training_inputs: &SMatrix<SM>,
_training_outputs: &SVector<SV>,
)
fn heuristic_fit<SM: Storage<f64, Dyn, Dyn>, SV: Storage<f64, Dyn, U1>>( &mut self, _training_inputs: &SMatrix<SM>, _training_outputs: &SVector<SV>, )
Optional, function that fits the kernel parameters on the training data using fast heuristics.
This is used as a starting point for gradient descent.
Source§impl Serialize for Multiquadric
impl Serialize for Multiquadric
impl Copy for Multiquadric
Auto Trait Implementations§
impl Freeze for Multiquadric
impl RefUnwindSafe for Multiquadric
impl Send for Multiquadric
impl Sync for Multiquadric
impl Unpin for Multiquadric
impl UnsafeUnpin for Multiquadric
impl UnwindSafe for Multiquadric
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.