def _f_score(precision, recall, beta2):  # pylint: disable=invalid-name
  """Returns F-score.

  Args:
    precision: a precision score.
    recall: a recall score.
    beta2: a square of the parameter that determines the weight of recall.

  A support function to calculate F-score for the single category.
  """
  return _non_nan(
      (beta2 + 1) * (precision * recall) / ((beta2 * precision) + recall))
Returns F-score.

  Args:
    precision: a precision score.
    recall: a recall score.
    beta2: a square of the parameter that determines the weight of recall.

  A support function to calculate F-score for the single category.
  
trax/layers/metrics.py