class_docstr: The model averaging is based on paper
  "Stochastic Gradient Descent for Non-smooth Optimization: Convergence
  Results and Optimal Averaging Schemes",
  (http://proceedings.mlr.press/v28/shamir13.pdf), which implements
  polynomial-decay averaging, parameterized by eta. When eta = 0, it is
  equivalent to simple average over all iterations with same weights.
docstr: When validating/evaluating the averaged model in the half way of
  training, use load_averaged_model first to load the averaged model and
  overwrite the current model, do the evaluation, and then use
  load_cached_model to load the current model back.
  
  Parameters
  ----------
  model
      The model that the averaged model is loaded to.
docstr_tok: ["When","validating\/evaluating","the","averaged","model","in","the","half","way","of","training",",","use","load_averaged_model","first","to","load","the","averaged","model","and","overwrite","the","current","model",",","do","the","evaluation",",","and","then","use","load_cached_model","to","load","the","current","model","back",".","Parameters","--","--","--","--","--","model","The","model","that","the","averaged","model","is","loaded","to","."]
code: def load_averaged_model(self, model: nn.HybridBlock):
      r"""
      When validating/evaluating the averaged model in the half way of
      training, use load_averaged_model first to load the averaged model and
      overwrite the current model, do the evaluation, and then use
      load_cached_model to load the current model back.
  
      Parameters
      ----------
      model
          The model that the averaged model is loaded to.
      """
      if self.averaged_model is not None:
          # cache the current model
          if self.cached_model is None:
              self.cached_model = {
                  k: v.list_data()[0].copy()
                  for k, v in model.collect_params().items()
              }
          else:
              for name, param_cached in self.cached_model.items():
                  param_cached[:] = model.collect_params()[
                      name
                  ].list_data()[0]
          # load the averaged model
          for name, param_avg in self.averaged_model.items():
              model.collect_params()[name].set_data(param_avg)
  
imports: from typing import Any, Dict, List, Optional
  import logging
  import mxnet
  import mxnet.gluon.nn
  from mxnet import gluon
  from gluonts.core.component import validated
  from .callback import Callback
label_desc: Use image node_id 5 for calling the IterationAveragingStrategy obj's underlying member method code with example usage: obj.load_averaged_model(model) without return types