Struct rusty_machine::learning::toolkit::kernel::Exponential
source · [−]pub struct Exponential {
pub ls: f64,
pub ampl: f64,
}
Expand description
The Exponential Kernel
k(x,y) = A exp(-||x-y|| / 2l2)
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
sourceimpl 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.
Examples
use rusty_machine::learning::toolkit::kernel;
use rusty_machine::learning::toolkit::kernel::Kernel;
// Construct a kernel with lengthscale 2 and amplitude 1.
let ker = kernel::Exponential::new(2f64, 1f64);
println!("{0}", ker.kernel(&[1.,2.,3.], &[3.,4.,5.]));
Trait Implementations
sourceimpl Clone for Exponential
impl Clone for Exponential
sourcefn clone(&self) -> Exponential
fn clone(&self) -> Exponential
Returns a copy of the value. Read more
1.0.0const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for Exponential
impl Debug for Exponential
sourceimpl Default for Exponential
impl Default for Exponential
Constructs the default Exponential kernel.
The defaults are:
- ls = 1
- amplitude = 1
sourcefn default() -> Exponential
fn default() -> Exponential
Returns the “default value” for a type. Read more
sourceimpl Kernel for Exponential
impl Kernel 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<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more