pub struct KernelProd<T, U>{ /* private fields */ }
Expand description
The pointwise product of two kernels
This struct should not be directly instantiated but instead is created when we multiply two kernels together.
Note that it will be more efficient to implement the final kernel manually yourself. However this provides an easy mechanism to test different combinations.
§Examples
use rusty_machine::learning::toolkit::kernel::{Kernel, Polynomial, HyperTan, KernelArith};
let poly_ker = Polynomial::new(1f64,2f64,3f64);
let hypert_ker = HyperTan::new(1f64,2.5);
let poly_plus_hypert_ker = KernelArith(poly_ker) * KernelArith(hypert_ker);
println!("{0}", poly_plus_hypert_ker.kernel(&[1f64,2f64,3f64],
&[3f64,1f64,2f64]));
Trait Implementations§
Source§impl<T, U> Debug for KernelProd<T, U>
impl<T, U> Debug for KernelProd<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for KernelProd<T, U>
impl<T, U> RefUnwindSafe for KernelProd<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for KernelProd<T, U>
impl<T, U> Sync for KernelProd<T, U>
impl<T, U> Unpin for KernelProd<T, U>
impl<T, U> UnwindSafe for KernelProd<T, U>where
T: UnwindSafe,
U: UnwindSafe,
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