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
impl PlasticityEngine
Sourcepub fn new(graph: &Graph, config: PlasticityConfig) -> Self
pub fn new(graph: &Graph, config: PlasticityConfig) -> Self
Create engine bound to current graph generation. Replaces: plasticity.py PlasticityEngine.init()
Sourcepub fn update(
&mut self,
graph: &mut Graph,
activated_nodes: &[(NodeId, FiniteF32)],
seeds: &[(NodeId, FiniteF32)],
query_text: &str,
) -> M1ndResult<PlasticityResult>
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()
Sourcepub fn export_state(&self, graph: &Graph) -> M1ndResult<Vec<SynapticState>>
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()
Sourcepub fn import_state(
&mut self,
graph: &mut Graph,
states: &[SynapticState],
) -> M1ndResult<u32>
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()