Skip to main content

PlasticityEngine

Struct PlasticityEngine 

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

Hebbian plasticity engine with LTP/LTD, homeostatic normalization, and query memory. Writes weights atomically to CSR (FM-ACT-021). Checks graph generation on every operation (FM-PL-006). Replaces: plasticity.py PlasticityEngine

Implementations§

Source§

impl PlasticityEngine

Source

pub fn new(graph: &Graph, config: PlasticityConfig) -> Self

Create engine bound to current graph generation. Replaces: plasticity.py PlasticityEngine.init()

Source

pub fn update( &mut self, graph: &mut Graph, activated_nodes: &[(NodeId, FiniteF32)], seeds: &[(NodeId, FiniteF32)], query_text: &str, ) -> M1ndResult<PlasticityResult>

Full learning cycle: Hebbian strengthen + decay + LTP/LTD + homeostatic. Writes weights atomically to CSR via CAS (FM-ACT-021). Asserts graph generation match (FM-PL-006). Replaces: plasticity.py PlasticityEngine.query()

Source

pub fn export_state(&self, graph: &Graph) -> M1ndResult<Vec<SynapticState>>

Export synaptic state for persistence. FM-PL-008 fix: atomic write (temp file + rename). FM-PL-001 NaN firewall: non-finite weights fall back to original. Replaces: plasticity.py PlasticityEngine.export_state()

Source

pub fn import_state( &mut self, graph: &mut Graph, states: &[SynapticState], ) -> M1ndResult<u32>

Import synaptic state from persistence. FM-PL-007 fix: validates JSON schema, wraps in try/catch. FM-PL-009 fix: validates relation match for edge identity via label-triple matching. Replaces: plasticity.py PlasticityEngine.import_state()

Source

pub fn get_priming( &self, seeds: &[NodeId], boost_strength: FiniteF32, ) -> Vec<(NodeId, FiniteF32)>

Get priming signal from query memory.

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> 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, 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.