pub enum SampleInvariant {
StimulusLenMismatch {
expected: usize,
got: usize,
},
NonFiniteStimulus {
channel: usize,
},
InfiniteReward,
}Expand description
Batch-admission invariant violated by one TrainingExample.
Produced by PlasticityTrainer::run_session’s preflight pass before any
network, modulator, eligibility, or metric state mutates. Single-step APIs
(train_step, train_step_with_modulators, and train_step_from_critic) do
not run this check — they stay compatible with their existing StepError
contracts, including NaN-reward skipping in train_step.
TrainingExample has no sample IDs, so ordering is the batch slice order
(index 0 is the first example). TrainingConfig currently has no invalid
encodings (use_reward_modulation is a bool); there is therefore no
config-level rejection variant.
Variants§
StimulusLenMismatch
stimuli.len() did not match SpikingNetwork::num_channels.
NonFiniteStimulus
A stimulus component was NaN or ±infinity.
InfiniteReward
Reward was ±infinity (NaN remains allowed: train_step skips modulation
and run_session omits it from avg_reward).
Trait Implementations§
Source§impl Clone for SampleInvariant
impl Clone for SampleInvariant
Source§fn clone(&self) -> SampleInvariant
fn clone(&self) -> SampleInvariant
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SampleInvariant
Source§impl Debug for SampleInvariant
impl Debug for SampleInvariant
Source§impl Display for SampleInvariant
impl Display for SampleInvariant
impl Eq for SampleInvariant
Source§impl Error for SampleInvariant
impl Error for SampleInvariant
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()