def METHOD_NAME(self, tp: torch.Tensor, fp: torch.Tensor,
                fn: torch.Tensor) -> float:
    """Compute the F1-score based on the true positives, false positives
    and false negatives.
    Args:
        tp (Tensor): The true positives.
        fp (Tensor): The false positives.
        fn (Tensor): The false negatives.
    Returns:
        float: The F1-score.
    """
    precision = tp / (tp + fp).clamp(min=1e-8)
    recall = tp / (tp + fn).clamp(min=1e-8)
    f1 = 2 * precision * recall / (precision + recall).clamp(min=1e-8)
    return float(f1.mean())