Struct friedrich::kernel::Exponential
source · Expand description
The Exponential Kernel.
k(x,y) = A exp(-||x-y|| / 2l²)
Where A is the amplitude and l is the length scale.
Fields§
§ls: f64
The length scale of the kernel.
ampl: f64
The amplitude of the kernel.
Implementations§
source§impl Exponential
impl Exponential
sourcepub fn new(ls: f64, ampl: f64) -> Exponential
pub fn new(ls: f64, ampl: f64) -> Exponential
Construct a new squared exponential kernel.
Trait Implementations§
source§impl Clone for Exponential
impl Clone for Exponential
source§fn clone(&self) -> Exponential
fn clone(&self) -> Exponential
Returns a copy 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 Exponential
impl Debug for Exponential
source§impl Default for Exponential
impl Default for Exponential
Constructs the default Exponential kernel.
The defaults are:
- ls = 1
- amplitude = 1
source§fn default() -> Exponential
fn default() -> Exponential
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for Exponential
impl<'de> Deserialize<'de> for Exponential
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 Exponential
impl Kernel for Exponential
source§fn kernel<S1: Storage<f64, U1, Dynamic>, S2: Storage<f64, U1, Dynamic>>(
&self,
x1: &SRowVector<S1>,
x2: &SRowVector<S2>
) -> f64
fn kernel<S1: Storage<f64, U1, Dynamic>, S2: Storage<f64, U1, Dynamic>>(
&self,
x1: &SRowVector<S1>,
x2: &SRowVector<S2>
) -> f64
The squared exponential kernel function.
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 is_scalable(&self) -> bool
fn is_scalable(&self) -> bool
source§fn gradient<S1: Storage<f64, U1, Dynamic>, S2: Storage<f64, U1, Dynamic>>(
&self,
x1: &SRowVector<S1>,
x2: &SRowVector<S2>
) -> Vec<f64>
fn gradient<S1: Storage<f64, U1, Dynamic>, S2: Storage<f64, U1, Dynamic>>(
&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 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 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 heuristic_fit<SM: Storage<f64, Dynamic, Dynamic>, SV: Storage<f64, Dynamic, U1>>(
&mut self,
training_inputs: &SMatrix<SM>,
training_outputs: &SVector<SV>
)
fn heuristic_fit<SM: Storage<f64, Dynamic, Dynamic>, SV: Storage<f64, Dynamic, 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. Read more
source§impl Serialize for Exponential
impl Serialize for Exponential
impl Copy for Exponential
Auto Trait Implementations§
impl RefUnwindSafe for Exponential
impl Send for Exponential
impl Sync for Exponential
impl Unpin for Exponential
impl UnwindSafe for Exponential
Blanket Implementations§
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.