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§
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.
§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§
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
Constructs the default Exponential kernel.
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 Kernel for Exponential
impl Kernel for Exponential
impl Copy for Exponential
Auto Trait Implementations§
impl Freeze for Exponential
impl RefUnwindSafe for Exponential
impl Send for Exponential
impl Sync for Exponential
impl Unpin for Exponential
impl UnwindSafe for Exponential
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