Decode recorded activity
Does emitted activity retain task information?
Native response success and information recoverable from neural activity are
different questions. decode fits an offline linear ridge diagnostic at three
points: cue_end, delay_end and response. It never feeds predictions or
diagnostic labels back to the online controller.
The supported tasks are delayed cue, recall interference, delayed XOR, evidence accumulation, context integration and temporal order. Physical tasks and reversal sessions are excluded.
Record complete fixed-wiring blocks
The default decoder requires exactly 640 complete trials per block:
256 fit, 128 validation and 256 evaluation trials. Construct once per block and
fully reset between trials. Select probe_events recording rather than a dense
all-tick trajectory.
from brainlesslab import ( CompositionSpec, EvaluationSpec, ExecutionSpec, NodeSpec, TaskSpec, decode, profile, resolve,)
plan = profile( CompositionSpec(node=NodeSpec("sorn"), task=TaskSpec("delayed_cue", options={"delays": [32]}), count=32), evaluation=EvaluationSpec(blocks=2, trials_per_block=640, construction_scope="block", root_seed=119),)resolved = resolve(plan)recording = ExecutionSpec(recording="probe_events")print(resolved.targets[0].horizon, plan.evaluation.trials_per_block)
def analyse_recorded_result(result): return decode(result.events, result.probe_trials)Expect 48 640. This snippet resolves the protocol without running 1,280 trials.
When ready, pass plan and recording to execute, then pass its result to the
function above. Budget that execution explicitly.
Each event owns its feature array and carries stable target, task, block, trial,
entity and feature IDs, observation point, tick and diagnostic label.
cue_end is after the initial cue, delay_end is the response start and
response averages emitted activity over response ticks. Two points at the same
tick remain separate named observations.
Fit without leaking evaluation information
All three points share the same whole-trial split within a block.
Each point fits its own centre and population standard deviation on fit trials
only; zero standard deviations become one. The decoder uses binary signed targets,
a fitted intercept and ridge penalties [1e-4, 1e-2, 1, 100].
Validation accuracy selects a penalty independently for each point. Exact ties choose the smaller penalty. Evaluation trials are used once after that choice; a score of zero predicts left.
The permutation null separately shuffles fit labels and validation labels. Evaluation labels remain untouched. Native accuracy and the fit-majority constant reference use the same evaluation subset as the decoder.
Check the returned evidence
Results retain coefficients, scaler values, chosen penalties, split trial IDs, predictions and metadata. Reject missing or duplicate observations, incompatible feature identities, changing wiring or interface signatures, repeated world seeds, incomplete trials and splits lacking either class.
The default offline memory budget is 32 MiB and is separate from managed runtime memory. Custom split counts remain explicit analysis choices, not extra trials.
Decodability shows that a particular diagnostic can recover labels from recorded features. It does not establish that the controller uses this information. For intervals, independent blocks remain the inferential units. Continue with analysis and calibration and records.