paddleaudio.metric.eer module

paddleaudio.metric.eer.compute_eer(labels: ndarray, scores: ndarray) List[float][source]

Compute EER and return score threshold.

Args:

labels (np.ndarray): the trial label, shape: [N], one-dimention, N refer to the samples num scores (np.ndarray): the trial scores, shape: [N], one-dimention, N refer to the samples num

Returns:

List[float]: eer and the specific threshold

paddleaudio.metric.eer.compute_minDCF(positive_scores, negative_scores, c_miss=1.0, c_fa=1.0, p_target=0.01)[source]

This is modified from SpeechBrain https://github.com/speechbrain/speechbrain/blob/085be635c07f16d42cd1295045bc46c407f1e15b/speechbrain/utils/metric_stats.py#L509 Computes the minDCF metric normally used to evaluate speaker verification systems. The min_DCF is the minimum of the following C_det function computed within the defined threshold range:

C_det = c_miss * p_miss * p_target + c_fa * p_fa * (1 -p_target)

where p_miss is the missing probability and p_fa is the probability of having a false alarm.

Args:

positive_scores (Paddle.Tensor): The scores from entries of the same class. negative_scores (Paddle.Tensor): The scores from entries of different classes. c_miss (float, optional): Cost assigned to a missing error (default 1.0). c_fa (float, optional): Cost assigned to a false alarm (default 1.0). p_target (float, optional): Prior probability of having a target (default 0.01).

Returns:

List[float]: min dcf and the specific threshold