BPS#
- class ibl_bwb_eval.metrics.BPS(num_outputs=None, degenerate_value=None, eps=1e-09, validate_finite=True, **kwargs)[source]#
Bases:
torchmetrics.metric.MetricBits Per Spike metric for Poisson spiking data.
Assumes log-rates for the predictions.
The number of units is inferred automatically from the last dimension of the first call to
update(), or can be provided explicitly vianum_outputs.\[\frac{N_{null} - N_{pred}}{n_{sp} \cdot \log 2}\]- Parameters:
num_outputs (
Optional[int]) – Number of units. If provided, states are pre-allocated eagerly; otherwise the size is inferred from the last dim of the firstupdate()call.degenerate_value (
Optional[Tensor]) – The value to return when the metric is degenerate.eps (
float) – The epsilon value to use for numerical stability.validate_finite (
bool) – Whether to checkpredsfor NaN/inf on everyupdate(). Disable only when the caller already trustspredsis finite (e.g. scoring predictions written by a validated pipeline).
References