PSTH

Peri-stimulus time histogram baseline.

Source

  • Registry name: psth
  • Model class: ladys.models.baselines.PSTH
  • Config class: ladys.models.baselines.PSTHConfig
  • Source file: src/ladys/models/baselines.py

When to use

Use PSTH as the simplest condition-averaged firing-rate baseline. On NLB files prepared with condition indices, the adapter smooths training held-out spikes, averages them within each condition, and maps those condition means onto eval trials. On synthetic datasets without condition metadata, it fits a time-varying mean rate from the training loader and repeats it for every validation trial.

Assumptions

NLB condition-index tensors are expected to use the same ordering as train_spikes_heldout and eval_spikes_heldout. kern_sd_ms and bin_size_ms define smoothing applied before training-trial averaging; the default 70 ms kernel matches NLB's MC_Maze PSTH construction. The target-side psth tensor written by nlb_tools is not used for prediction because it is evaluation metadata. Generic datasets are treated as one condition, so this is a deliberately weak time-only baseline.

Outputs

forward returns the fitted time-varying mean rates when available. NLB evaluation bypasses forward and returns condition-matched held-out training PSTH rates directly from the prepared H5 tensors.

Configuration

Config for the peri-stimulus time histogram baseline.

Field Type Default
name Literal['psth'] 'psth'
objective str 'psth_poisson_nll'
kern_sd_ms float 70.0
bin_size_ms float 5.0
prediction_floor float 1e-09
optimization OptimizationConfig OptimizationConfig(name='inference_only')

Contracts