pub struct VgmmConfig {
pub n_components: usize,
pub prior_concentration: f64,
pub prior_mean: f64,
pub prior_precision: f64,
pub observation_precision: f64,
pub component_precisions: Option<Vec<f64>>,
pub max_iterations: usize,
pub tolerance: f64,
pub divergence_tolerance: f64,
pub seed: u64,
}Expand description
Configuration for VariationalGaussianMixture.
All fields are validated on VariationalGaussianMixture::new via the
private VgmmConfig::validate method. Use the builder helpers to
construct a config; the VgmmConfig::new constructor provides sensible
research-preview defaults.
Fields§
§n_components: usizeNumber of mixture components K (must be ≥ 1).
prior_concentration: f64Symmetric Dirichlet prior concentration α₀ > 0 for each component.
prior_mean: f64Prior mean m₀ for each component’s Gaussian prior.
prior_precision: f64Prior precision β₀ > 0 for each component’s Gaussian prior.
observation_precision: f64Shared observation precision τ, used when component_precisions is
None. All τ_k are set to this value.
component_precisions: Option<Vec<f64>>Per-component observation precisions τ_k. When Some, the vector
length must equal n_components and every entry must be positive.
When None, observation_precision is replicated K times.
max_iterations: usizeMaximum number of VBEM iterations.
tolerance: f64ELBO absolute-change convergence tolerance.
divergence_tolerance: f64Maximum permissible ELBO decrease (used for divergence detection).
seed: u64Seed for the seeded RNG used during mean initialisation.
Implementations§
Source§impl VgmmConfig
impl VgmmConfig
Sourcepub fn new(n_components: usize) -> Self
pub fn new(n_components: usize) -> Self
Construct a config for n_components mixture components with
sensible defaults:
| Parameter | Default |
|---|---|
prior_concentration | 1.0 |
prior_mean | 0.0 |
prior_precision | 1e-3 |
observation_precision | 1.0 |
max_iterations | 200 |
tolerance | 1e-6 |
divergence_tolerance | 1e-4 |
seed | 0 |
Sourcepub fn with_prior(
self,
prior_mean: f64,
prior_precision: f64,
prior_concentration: f64,
) -> Self
pub fn with_prior( self, prior_mean: f64, prior_precision: f64, prior_concentration: f64, ) -> Self
Set the Gaussian prior hyperparameters for all component means.
prior_mean— prior mean m₀prior_precision— prior precision β₀ (must be > 0)prior_concentration— symmetric Dirichlet concentration α₀ (must be > 0)
Sourcepub fn with_observation_precision(self, tau: f64) -> Self
pub fn with_observation_precision(self, tau: f64) -> Self
Set the shared observation precision τ applied to all components.
Sourcepub fn with_component_precisions(self, taus: Vec<f64>) -> Result<Self>
pub fn with_component_precisions(self, taus: Vec<f64>) -> Result<Self>
Set per-component observation precisions τ_k. The vector length must
equal n_components and every entry must be strictly positive; this is
validated immediately.
Sourcepub fn with_limits(self, max_iterations: usize, tolerance: f64) -> Self
pub fn with_limits(self, max_iterations: usize, tolerance: f64) -> Self
Set iteration budget and ELBO tolerance.
Trait Implementations§
Source§impl Clone for VgmmConfig
impl Clone for VgmmConfig
Source§fn clone(&self) -> VgmmConfig
fn clone(&self) -> VgmmConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for VgmmConfig
impl RefUnwindSafe for VgmmConfig
impl Send for VgmmConfig
impl Sync for VgmmConfig
impl Unpin for VgmmConfig
impl UnsafeUnpin for VgmmConfig
impl UnwindSafe for VgmmConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.