PopCoupling#

class ts2.models.single_session.PopCoupling(sigma=None, gamma=None)[source]#

Bases: ts2.models.single_session.stat_baseline.base.StatBaseline

Population coupling.

Parameters:
  • sigma (Optional[float]) – Gaussian smoothing width (bins). None selects on val.

  • gamma (Optional[float]) – coupling exponent. None selects on val.

fit(train_dataset, val_dataset)[source]#

Select sigma and gamma on val.

Val feeds the full population, so a population sum including unit i would leak its own target into its prediction. Instead of leaving out only unit i, the trace leaves out a whole fold the size of the test hold-out, so selection reads the population the model reads at test; the folds tile the units, so every unit is still scored.

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