pub struct ICMKernel { /* private fields */ }Expand description
Intrinsic Coregionalization Model (ICM) kernel.
K((x, i), (y, j)) = B[i, j] * k(x, y)
where:
- B is the task covariance matrix (num_tasks x num_tasks)
- k is the base kernel on features
This model assumes all tasks share the same underlying kernel but with different task-specific scales captured in B.
Implementations§
Source§impl ICMKernel
impl ICMKernel
Sourcepub fn new(
base_kernel: Box<dyn Kernel>,
task_covariance: Vec<Vec<f64>>,
) -> Result<Self>
pub fn new( base_kernel: Box<dyn Kernel>, task_covariance: Vec<Vec<f64>>, ) -> Result<Self>
Create a new ICM kernel.
§Arguments
base_kernel- Kernel for feature similaritytask_covariance- Positive semi-definite task covariance matrix
Sourcepub fn independent(
base_kernel: Box<dyn Kernel>,
num_tasks: usize,
) -> Result<Self>
pub fn independent( base_kernel: Box<dyn Kernel>, num_tasks: usize, ) -> Result<Self>
Create ICM with identity task covariance (independent tasks).
Sourcepub fn uniform(
base_kernel: Box<dyn Kernel>,
num_tasks: usize,
correlation: f64,
) -> Result<Self>
pub fn uniform( base_kernel: Box<dyn Kernel>, num_tasks: usize, correlation: f64, ) -> Result<Self>
Create ICM with uniform task correlation.
Sourcepub fn from_rank1(
base_kernel: Box<dyn Kernel>,
task_variances: Vec<f64>,
) -> Result<Self>
pub fn from_rank1( base_kernel: Box<dyn Kernel>, task_variances: Vec<f64>, ) -> Result<Self>
Create ICM from rank-1 decomposition B = v * v^T.
This is useful when you have task-specific variances.
Sourcepub fn compute_tasks(&self, x: &TaskInput, y: &TaskInput) -> Result<f64>
pub fn compute_tasks(&self, x: &TaskInput, y: &TaskInput) -> Result<f64>
Compute ICM kernel value for task inputs.
Sourcepub fn task_covariance(&self) -> &Vec<Vec<f64>>
pub fn task_covariance(&self) -> &Vec<Vec<f64>>
Get task covariance matrix.
Auto Trait Implementations§
impl Freeze for ICMKernel
impl !RefUnwindSafe for ICMKernel
impl Send for ICMKernel
impl Sync for ICMKernel
impl Unpin for ICMKernel
impl !UnwindSafe for ICMKernel
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> 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