callcut.evaluation.BaseDecoder🔗

class callcut.evaluation.BaseDecoder[source]🔗

Abstract base class for probability-to-interval decoders.

Subclasses must implement decode() to convert frame-level probabilities into a list of detected call intervals.

Methods

decode(times, probabilities)

Convert frame probabilities to a list of time intervals.

Examples

Create a custom decoder by subclassing:

>>> class SimpleThresholdDecoder(BaseDecoder):
...     def __init__(self, threshold: float = 0.5):
...         self._threshold = threshold
...
...     def decode(self, times, probabilities):
...         # Implementation here
...         ...
abstractmethod decode(times, probabilities)[source]🔗

Convert frame probabilities to a list of time intervals.

Parameters:
timesTensor of shape (n_frames,)

Time axis of shape (n_frames,) in seconds, from the feature extractor.

probabilitiesTensor of shape (n_frames,)

Per-frame probabilities of shape (n_frames,), values in [0, 1], from predict().

Returns:
intervalslist of Interval

Detected call intervals, sorted by onset time.