pub struct NeuronCache { /* private fields */ }Expand description
Neuron activation cache for hot/cold management.
Tracks neuron activation frequencies and maintains a cache of frequently accessed (“hot”) neuron weights.
Implementations§
Source§impl NeuronCache
impl NeuronCache
Sourcepub fn new(num_neurons: usize, config: CacheConfig) -> Self
pub fn new(num_neurons: usize, config: CacheConfig) -> Self
Create a new neuron cache from config.
Sourcepub fn with_threshold(num_neurons: usize, hot_threshold: f64) -> Self
pub fn with_threshold(num_neurons: usize, hot_threshold: f64) -> Self
Create a new neuron cache with explicit threshold.
Sourcepub fn record_activations(&mut self, active_neurons: &[usize])
pub fn record_activations(&mut self, active_neurons: &[usize])
Record neuron activations.
Sourcepub fn reclassify(&mut self)
pub fn reclassify(&mut self)
Reclassify neurons as hot or cold.
Sourcepub fn hot_neurons(&self) -> &[usize]
pub fn hot_neurons(&self) -> &[usize]
Get hot neurons.
Sourcepub fn cold_neurons(&self) -> &[usize]
pub fn cold_neurons(&self) -> &[usize]
Get cold neurons.
Sourcepub fn activation_frequency(&self, neuron: usize) -> f64
pub fn activation_frequency(&self, neuron: usize) -> f64
Get activation frequency for a neuron.
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Get cache statistics.
Trait Implementations§
Source§impl Clone for NeuronCache
impl Clone for NeuronCache
Source§fn clone(&self) -> NeuronCache
fn clone(&self) -> NeuronCache
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NeuronCache
impl RefUnwindSafe for NeuronCache
impl Send for NeuronCache
impl Sync for NeuronCache
impl Unpin for NeuronCache
impl UnwindSafe for NeuronCache
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
Mutably borrows from an owned value. Read more