class_docstr: A class to store the evaluation metrics.
docstr: Calculate the evaluation metrics for the whole epoch.
  
  Raises:
    ValueError: If no examples were accumulated.
  
  Returns:
    dictionary: a dictionary storing the evaluation metrics for the epoch. The
      dictionary has the fields: avg_hit_at_one, avg_perr, avg_loss, and
      aps (default nan).
docstr_tok: ["Calculate","the","evaluation","metrics","for","the","whole","epoch",".","Raises",":","ValueError",":","If","no","examples","were","accumulated",".","Returns",":","dictionary",":","a","dictionary","storing","the","evaluation","metrics","for","the","epoch",".","The","dictionary","has","the","fields",":","avg_hit_at_one",",","avg_perr",",","avg_loss",",","and","aps","(","default","nan",")","."]
code: def get(self):
      """Calculate the evaluation metrics for the whole epoch.
  
      Raises:
        ValueError: If no examples were accumulated.
  
      Returns:
        dictionary: a dictionary storing the evaluation metrics for the epoch. The
          dictionary has the fields: avg_hit_at_one, avg_perr, avg_loss, and
          aps (default nan).
      """
      if self.num_examples <= 0:
          raise ValueError("total_sample must be positive.")
      avg_hit_at_one = self.sum_hit_at_one / self.num_examples
      avg_perr = self.sum_perr / self.num_examples
      avg_loss = self.sum_loss / self.num_examples
  
      aps = self.map_calculator.peek_map_at_n()
      gap = self.global_ap_calculator.peek_ap_at_n()
  
      epoch_info_dict = {}
      return {
          "avg_hit_at_one": avg_hit_at_one,
          "avg_perr": avg_perr,
          "avg_loss": avg_loss,
          "aps": aps,
          "gap": gap,
      }
  
file_path: PaddleHub/modules/video/classification/videotag_tsn_lstm/resource/metrics/youtube8m/eval_util.py
imports: import datetime
  import numpy
  from .None import mean_average_precision_calculator
  from .None import average_precision_calculator
label_desc: Use image node_id 3 for calling the EvaluationMetrics obj's underlying member method code with example usage: obj.get() and returns: dict