Skip to main content

ProbabilityStore

Struct ProbabilityStore 

Source
pub struct ProbabilityStore { /* private fields */ }
Expand description

Append-only probability evidence store.

Implementations§

Source§

impl ProbabilityStore

Source

pub const fn new() -> Self

Source

pub const fn from_records(records: Vec<ProbabilityEvidence>) -> Self

Source

pub fn record(&mut self, evidence: ProbabilityEvidence) -> String

Source

pub fn update( &mut self, target: impl Into<String>, observation: impl Into<String>, weight: f32, provenance: impl Into<String>, recorded_at: impl Into<String>, ) -> String

Source

pub fn reinforce_transition_path<S: AsRef<str>>( &mut self, path: &[S], reward: f32, provenance: impl Into<String>, recorded_at: impl Into<String>, ) -> Vec<String>

Reinforce a whole episode’s trajectory in one shot — the deterministic, append-only counterpart of the paper’s global feedback (episode-wide one-shot update) from arXiv:2605.00940.

Given an ordered path of visited states [s0, s1, ..., sn], this appends one ProbabilityModel::MarkovTransition record per adjacent pair (s_i -> s_{i+1}), each carrying the shared episode reward as its utility U and the same provenance/recorded_at stamp, so the entire episode is reinforced together rather than transition by transition. The recorded evidence is then visible to Self::target_weight / Self::target_evidence_count under the matching markov_from state, exactly like any other transition observation.

Returns the ids of the appended records in path order. A path with fewer than two states has no transitions, so it records nothing and returns an empty vector.

Source

pub fn records(&self) -> &[ProbabilityEvidence]

Source

pub fn target_weight( &self, target: &str, offline: bool, markov_from: Option<&str>, ) -> f32

Source

pub fn target_evidence_count( &self, target: &str, offline: bool, markov_from: Option<&str>, ) -> usize

Count the number of append-only observations that support target.

This is the symbolic analogue of the evidence count C from Kolonin’s “Interpretable Experiential Learning” (arXiv:2605.00940): every recorded observation is one unit of evidence for a transition/answer, kept separate from the accumulated utility (target_weight) so that a rarely seen high-weight transition can be told apart from a frequently confirmed one. The same offline and Markov-state filters as Self::target_weight apply, so utility and count always describe the same evidence subset.

Source

pub fn nearest_similar_evidence( &self, target: &str, offline: bool, markov_from: Option<&str>, threshold: f32, ) -> Option<SimilarEvidence>

Reuse the nearest stored target’s evidence when target has none of its own — the symbolic counterpart of the paper’s cosine-similarity SS fallback over stored situations.

Among the distinct targets that carry usable evidence under the same offline/Markov filters (excluding target itself), this returns the one whose symbolic_cosine_similarity to target is highest and at least threshold. Ties are broken by target name so the choice is deterministic. Returns None when nothing clears the threshold.

Source

pub fn replay_into_event_log(&self, log: &mut EventLog, offline: bool) -> usize

Trait Implementations§

Source§

impl Clone for ProbabilityStore

Source§

fn clone(&self) -> ProbabilityStore

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProbabilityStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProbabilityStore

Source§

fn default() -> ProbabilityStore

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ProbabilityStore

Source§

fn eq(&self, other: &ProbabilityStore) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ProbabilityStore

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more