pub struct HyperTan {
pub alpha: f64,
pub c: f64,
}
Expand description
The Hyperbolic Tangent Kernel.
ker(x,y) = tanh(αxTy + c)
Fields
alpha: f64
The scaling of the inner product.
c: f64
The constant to add to the inner product.
Implementations
sourceimpl HyperTan
impl HyperTan
sourcepub fn new(alpha: f64, c: f64) -> HyperTan
pub fn new(alpha: f64, c: f64) -> HyperTan
Constructs a new Hyperbolic Tangent Kernel.
Examples
use rusty_machine::learning::toolkit::kernel;
use rusty_machine::learning::toolkit::kernel::Kernel;
// Construct a kernel with alpha = 1, c = 2.
let ker = kernel::HyperTan::new(1.0, 2.0);
println!("{0}", ker.kernel(&[1.,2.,3.], &[3.,4.,5.]));
Trait Implementations
sourceimpl Default for HyperTan
impl Default for HyperTan
Constructs a default Hyperbolic Tangent Kernel.
The defaults are:
- alpha = 1
- c = 0
impl Copy for HyperTan
Auto Trait Implementations
impl RefUnwindSafe for HyperTan
impl Send for HyperTan
impl Sync for HyperTan
impl Unpin for HyperTan
impl UnwindSafe for HyperTan
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