class_docstr: Implementation of `Lookahead Optimizer: k steps forward, 1 step back <https://arxiv.org/abs/1907.08610>`_
  
  Args:
      :param optimizer:       - the optimizer to work with (sgd, adam etc)
      :param k: (int)         - number of steps to look ahead (default=5)
      :param alpha: (float)   - slow weights step size
code: def state_dict(self):
      fast_state_dict = self.optimizer.state_dict()
      slow_state = {
          (id(k) if isinstance(k, torch.Tensor) else k): v
          for k, v in self.state.items()
      }
      fast_state = fast_state_dict["state"]
      param_groups = fast_state_dict["param_groups"]
      return {
          "fast_state": fast_state,
          "slow_state": slow_state,
          "param_groups": param_groups,
      }
  
file_path: pywick/pywick/optimizers/lookahead.py
imports: from collections import defaultdict
  from torch.optim.optimizer import Optimizer
  import torch
label_desc: Use image node_id 5 for calling the Lookahead obj's underlying member method code with example usage: obj.state_dict() and returns: dict