RRRReadout#

class ts2.models.single_session.RRRReadout(rank=None, ridge_lambda=None)[source]#

Bases: ts2.models.single_session.stat_baseline.co_smoothing._readout_base.RRRReadoutBase

Reduced-rank readout over binned counts.

Parameters:
  • rank (Optional[int]) – reduced rank k. None selects on val.

  • ridge_lambda (Optional[float]) – ridge strength. None selects on val.

fit(train_dataset, val_dataset)[source]#

Fit on train, select hyperparameters on val, and record val_score.

Subclasses pull what they need via _windows() or off the dataset. The mean rate needs neither, so this is a no-op and the default val_score already covers it (see MeanRate).

predict(spikes, **_)[source]#

Log-rates (B, T, N).

At test the held-out entries are already zeroed, so the observed population / past is exactly the non-masked data.

Return type:

Tensor