pub struct Prior { /* private fields */ }Expand description
A prior for the PPCA model. Use this class to mitigate overfit on training (especially on frequently masked dimensions) and to input a priori knowledge on what the PPCA should look like.
Implementations§
source§impl Prior
impl Prior
sourcepub fn with_mean_prior(
self,
mean: DVector<f64>,
mean_covariance: DMatrix<f64>
) -> Self
pub fn with_mean_prior(
self,
mean: DVector<f64>,
mean_covariance: DMatrix<f64>
) -> Self
Add a prior to the mean of the PPCA. The prior is a normal multivariate distribution.
sourcepub fn with_isotropic_noise_prior(self, alpha: f64, beta: f64) -> Self
pub fn with_isotropic_noise_prior(self, alpha: f64, beta: f64) -> Self
Add an isotropic noise prior. The prior is an Inverse Gamma distribution with shape alpha
and rate beta.
sourcepub fn with_transformation_precision(self, precision: f64) -> Self
pub fn with_transformation_precision(self, precision: f64) -> Self
Impose an independent Normal prior to each dimension of the transformation matrix. The
precision is the inverse of the variance of the Normal distribution (1 / sigma ^ 2).
pub fn mean(&self) -> Option<&DVector<f64>>
pub fn mean_covariance(&self) -> Option<&DMatrix<f64>>
pub fn has_isotropic_noise_prior(&self) -> bool
pub fn isotropic_noise_alpha(&self) -> f64
pub fn isotropic_noise_beta(&self) -> f64
pub fn transformation_precision(&self) -> f64
pub fn has_mean_prior(&self) -> bool
Trait Implementations§
source§impl<'de> Deserialize<'de> for Prior
impl<'de> Deserialize<'de> for Prior
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Prior
impl Send for Prior
impl Sync for Prior
impl Unpin for Prior
impl UnwindSafe for Prior
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.