pub(crate) mod factor;
mod fitted;
mod model;
mod objective;
mod online;
mod distance;
#[cfg(test)]
mod tests;
use crate::kernel::{CompiledKernel, KernelScalar, NoSupply, Supply};
pub use fitted::FittedSgpr;
pub use model::Sgpr;
pub(crate) use objective::SgprObjective;
pub(crate) use online::InducingRegistry;
pub use online::{InducingId, OnlineSgpr};
#[derive(Clone, Copy, Debug, Default)]
pub struct FixedInducing;
#[derive(Clone, Copy, Debug, Default)]
pub struct FreeInducing;
pub trait InducingLayout<U: Supply>: Clone {
fn z_params(m: usize, d: usize) -> usize;
fn free_z<T: KernelScalar>(
compiled: &CompiledKernel<T, U>,
) -> Option<&CompiledKernel<T, NoSupply>>;
}
impl<U: Supply> InducingLayout<U> for FixedInducing {
fn z_params(_m: usize, _d: usize) -> usize {
0
}
fn free_z<T: KernelScalar>(
_compiled: &CompiledKernel<T, U>,
) -> Option<&CompiledKernel<T, NoSupply>> {
None
}
}
impl InducingLayout<NoSupply> for FreeInducing {
fn z_params(m: usize, d: usize) -> usize {
m * d
}
fn free_z<T: KernelScalar>(
compiled: &CompiledKernel<T, NoSupply>,
) -> Option<&CompiledKernel<T, NoSupply>> {
Some(compiled)
}
}