pub struct SelfModel { /* private fields */ }Expand description
The machine’s model of its own dynamics.
Implementations§
Source§impl SelfModel
impl SelfModel
pub fn new(forgetting: f64) -> SelfModel
pub fn updates(&self) -> u64
pub fn scored(&self) -> u64
pub fn interval_ns(&self) -> u64
pub fn tracked_cells(&self) -> usize
Sourcepub fn observe(&mut self, snapshot: &MirrorSnapshot)
pub fn observe(&mut self, snapshot: &MirrorSnapshot)
Take in a reflection: score the last prediction, then update.
Scoring before updating matters. A model that updated first would be grading itself on data it had already seen, which is the most common way to accidentally report excellent predictive performance.
Sourcepub fn predict_next(&mut self) -> Vec<Prediction>
pub fn predict_next(&mut self) -> Vec<Prediction>
Predict every cell’s next value, and remember the predictions so the next reflection can score them.
Sourcepub fn predict_cell(&self, row: usize, col: usize) -> Option<Prediction>
pub fn predict_cell(&self, row: usize, col: usize) -> Option<Prediction>
Predict one cell without recording it for scoring.
Sourcepub fn skill(&self) -> f64
pub fn skill(&self) -> f64
Typical skill across every cell that has been scored enough to judge.
The headline number: how much better than “nothing changed” this model is, on this machine, right now.
§Median, not mean
A machine has cells of wildly different scales, and a mean lets one pathological cell decide the figure for all of them. The median says what a typical cell does, which is what the question is actually asking.
Sourcepub fn cells_with_skill(&self, threshold: f64) -> Vec<(usize, usize, f64)>
pub fn cells_with_skill(&self, threshold: f64) -> Vec<(usize, usize, f64)>
Cells the model predicts meaningfully better than the baseline.
Sourcepub fn predict_state(&self, catalogue: &LatentCatalogue) -> StatePrediction
pub fn predict_state(&self, catalogue: &LatentCatalogue) -> StatePrediction
Predict which latent state comes next, from the catalogue’s own transition history.