pub struct EmlCoherenceModel { /* private fields */ }Expand description
Depth-4 multi-head EML master formula for O(1) coherence prediction.
This is a thin wrapper around eml_core::EmlModel that provides
the WeftOS-specific GraphFeatures and CoherencePrediction types.
Backward compatible: supports both depth-3 (34 params, single output) and depth-4 (50 params, multi-head) architectures.
Implementations§
Source§impl EmlCoherenceModel
impl EmlCoherenceModel
Sourcepub fn drain_events(&mut self) -> Vec<EmlEvent>
pub fn drain_events(&mut self) -> Vec<EmlEvent>
Drain accumulated EML lifecycle events for ExoChain forwarding.
Sourcepub fn is_multi_head(&self) -> bool
pub fn is_multi_head(&self) -> bool
Whether this model uses the depth-4 multi-head architecture.
Sourcepub fn is_trained(&self) -> bool
pub fn is_trained(&self) -> bool
Whether the model has been trained to convergence.
Sourcepub fn training_sample_count(&self) -> usize
pub fn training_sample_count(&self) -> usize
Number of training samples collected so far.
Sourcepub fn mean_error(&self) -> f64
pub fn mean_error(&self) -> f64
Mean of the recent error history (empty => 0.0).
Sourcepub fn predict(&self, features: &GraphFeatures) -> CoherencePrediction
pub fn predict(&self, features: &GraphFeatures) -> CoherencePrediction
O(1) multi-head coherence prediction from graph features.
Returns a CoherencePrediction with lambda_2, fiedler_norm, and
uncertainty. Falls back to a density-based estimate if untrained.
For depth-3 legacy models, fiedler_norm and uncertainty are
synthetic estimates derived from lambda_2.
Sourcepub fn predict_lambda2(&self, features: &GraphFeatures) -> f64
pub fn predict_lambda2(&self, features: &GraphFeatures) -> f64
Convenience: returns only the primary lambda_2 value.
Use this when you only need the algebraic connectivity scalar
(backward compatible with callers that expected f64).
Sourcepub fn record(&mut self, features: GraphFeatures, lambda_2: f64)
pub fn record(&mut self, features: GraphFeatures, lambda_2: f64)
Record a training point (called after every exact Lanczos computation).
Only records lambda_2; use [record_full] to also supply Fiedler norm
and uncertainty ground truth.
Sourcepub fn record_full(
&mut self,
features: GraphFeatures,
lambda_2: f64,
fiedler_norm: Option<f64>,
uncertainty: Option<f64>,
)
pub fn record_full( &mut self, features: GraphFeatures, lambda_2: f64, fiedler_norm: Option<f64>, uncertainty: Option<f64>, )
Record a full training point with optional Fiedler norm and uncertainty.
Trait Implementations§
Source§impl Clone for EmlCoherenceModel
impl Clone for EmlCoherenceModel
Source§impl Debug for EmlCoherenceModel
impl Debug for EmlCoherenceModel
Source§impl Default for EmlCoherenceModel
impl Default for EmlCoherenceModel
Source§impl<'de> Deserialize<'de> for EmlCoherenceModel
impl<'de> Deserialize<'de> for EmlCoherenceModel
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>,
Auto Trait Implementations§
impl Freeze for EmlCoherenceModel
impl RefUnwindSafe for EmlCoherenceModel
impl Send for EmlCoherenceModel
impl Sync for EmlCoherenceModel
impl Unpin for EmlCoherenceModel
impl UnsafeUnpin for EmlCoherenceModel
impl UnwindSafe for EmlCoherenceModel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 more