class_docstr: Adapted from `improved_diffusion.train_util.TrainLoop`
  (https://github.com/openai/improved-diffusion)
  to remove MPI broadcasts for parameter loading.
class_docstr_tok: ["Adapted","from","`","improved_diffusion.train_util.TrainLoop","`","(","https",":","\/\/github.com\/openai\/improved-diffusion",")","to","remove","MPI","broadcasts","for","parameter","loading","."]
code: def _load_ema_parameters(self, rate: float) -> list:
      ema_params = copy.deepcopy(self.master_params)
  
      ema_checkpoint = train_util.find_ema_checkpoint(
          self.resume_checkpoint, self.resume_step, rate
      )
      if ema_checkpoint:
          if dist.get_rank() == 0:
              logger.log(
                  f"loading EMA from checkpoint: {ema_checkpoint}..."
              )
              state_dict = torch.load(
                  ema_checkpoint, map_location=dist_util.dev()
              )
              ema_params = self._state_dict_to_master_params(state_dict)
  
      dist_util.sync_params(ema_params)
      return ema_params
  
imports: import copy
  import hashlib
  from pathlib import Path
  from typing import List, Set, Union
  import numpy
  import plotly.graph_objs
  import torch
  import torch.distributed
  import wandb
  from hydra.core.hydra_config import HydraConfig
  from hydra.utils import instantiate, to_absolute_path
  from improved_diffusion import dist_util
  from improved_diffusion import gaussian_diffusion
  from improved_diffusion import logger, respace, train_util
  from omegaconf import DictConfig, OmegaConf
label_desc: Use image node_id 2 for calling the TrainLoop obj's underlying member method code with example usage: obj._load_ema_parameters(rate) and returns: ema_params