pub struct CausalCollapseModel { /* private fields */ }Expand description
EML-enhanced delta prediction for when the analytical formula is insufficient.
Learns corrections for: multi-edge batching, Fiedler staleness, phase transitions. The model trains on the residual (actual - analytical) so the analytical formula provides the baseline and the EML tree only needs to learn the error.
§Architecture
- Depth 3, 9 inputs, 1 head
- Inputs: fiedler_u, fiedler_v, edge_weight, current_lambda2, spectral_gap, graph_density, node_count, degree_u, degree_v
- Output: correction to add to the analytical prediction
Implementations§
Source§impl CausalCollapseModel
impl CausalCollapseModel
Sourcepub fn is_trained(&self) -> bool
pub fn is_trained(&self) -> bool
Whether the underlying EML model has been trained.
Sourcepub fn training_sample_count(&self) -> usize
pub fn training_sample_count(&self) -> usize
Number of training samples collected.
Sourcepub fn predict(&self, features: &CollapseFeatures) -> f64
pub fn predict(&self, features: &CollapseFeatures) -> f64
Predict with EML correction applied to analytical formula.
When the model is untrained, returns the pure analytical prediction. When trained, adds a learned correction that accounts for higher-order effects like Fiedler staleness and multi-edge batching.
Sourcepub fn record(&mut self, features: CollapseFeatures, actual_delta: f64)
pub fn record(&mut self, features: CollapseFeatures, actual_delta: f64)
Record a ground-truth observation for future training.
actual_delta is the real change in lambda_2 measured after adding
the edge. The model trains on the residual (actual - analytical).
Sourcepub fn train(&mut self) -> bool
pub fn train(&mut self) -> bool
Train the EML correction model.
Requires at least 50 training samples. Returns true if the model
converged (MSE < 0.01).
Sourcepub fn drain_events(&mut self) -> Vec<EmlEvent>
pub fn drain_events(&mut self) -> Vec<EmlEvent>
Drain accumulated EML lifecycle events for ExoChain forwarding.
Trait Implementations§
Source§impl Clone for CausalCollapseModel
impl Clone for CausalCollapseModel
Source§impl Debug for CausalCollapseModel
impl Debug for CausalCollapseModel
Source§impl Default for CausalCollapseModel
impl Default for CausalCollapseModel
Source§impl<'de> Deserialize<'de> for CausalCollapseModel
impl<'de> Deserialize<'de> for CausalCollapseModel
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 CausalCollapseModel
impl RefUnwindSafe for CausalCollapseModel
impl Send for CausalCollapseModel
impl Sync for CausalCollapseModel
impl Unpin for CausalCollapseModel
impl UnsafeUnpin for CausalCollapseModel
impl UnwindSafe for CausalCollapseModel
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