pub struct IndexKernel { /* private fields */ }Expand description
Index kernel: K(i, j) = B[i, j] where B is task covariance matrix.
Pure task-based similarity without feature component. Useful as a building block for more complex multi-task kernels.
Implementations§
Source§impl IndexKernel
impl IndexKernel
Sourcepub fn new(task_covariance: Vec<Vec<f64>>) -> Result<Self>
pub fn new(task_covariance: Vec<Vec<f64>>) -> Result<Self>
Create an index kernel from task covariance matrix.
The covariance matrix should be symmetric positive semi-definite.
Sourcepub fn identity(num_tasks: usize) -> Result<Self>
pub fn identity(num_tasks: usize) -> Result<Self>
Create with identity covariance (independent tasks).
Sourcepub fn uniform(num_tasks: usize, correlation: f64) -> Result<Self>
pub fn uniform(num_tasks: usize, correlation: f64) -> Result<Self>
Create with uniform covariance (all tasks equally similar).
Sourcepub fn get_task_covariance(&self, task_i: usize, task_j: usize) -> Result<f64>
pub fn get_task_covariance(&self, task_i: usize, task_j: usize) -> Result<f64>
Get task covariance value.
Sourcepub fn covariance_matrix(&self) -> &Vec<Vec<f64>>
pub fn covariance_matrix(&self) -> &Vec<Vec<f64>>
Get the full covariance matrix.
Trait Implementations§
Source§impl Clone for IndexKernel
impl Clone for IndexKernel
Source§fn clone(&self) -> IndexKernel
fn clone(&self) -> IndexKernel
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for IndexKernel
impl RefUnwindSafe for IndexKernel
impl Send for IndexKernel
impl Sync for IndexKernel
impl Unpin for IndexKernel
impl UnwindSafe for IndexKernel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more