docstr: Parameters
  ----------
  num_models
      Number of model checkpoints to average.
  metric
      Metric which is used to average models.
  maximize
      Boolean flag to indicate whether the metric should be maximized or
      minimized.
docstr_tok: ["Parameters","--","--","--","--","--","num_models","Number","of","model","checkpoints","to","average",".","metric","Metric","which","is","used","to","average","models",".","maximize","Boolean","flag","to","indicate","whether","the","metric","should","be","maximized","or","minimized","."]
code: def __init__(
      self,
      num_models: int = 5,
      metric: str = "score",
      maximize: bool = False,
  ):
      r"""
      Parameters
      ----------
      num_models
          Number of model checkpoints to average.
      metric
          Metric which is used to average models.
      maximize
          Boolean flag to indicate whether the metric should be maximized or
          minimized.
      """
      self.num_models = num_models
      self.metric = metric
      self.maximize = maximize
  
imports: import glob
  import json
  import logging
  from typing import Dict, List, Tuple
  import mxnet
  import mxnet.gluon.nn
  import numpy
  from gluonts.core.component import validated
  from .callback import Callback
label_desc: Use image node_id 1 to create a new AveragingStrategy object  with example: obj = AveragingStrategy(num_models, metric, maximize)