class_docstr: Implements Lookahead optimization algorithm.
  
  It has been proposed in `Lookahead Optimizer: k steps forward, 1
  step back`__
  
  Arguments:
      optimizer: base inner optimizer optimize, like Yogi, DiffGrad or Adam.
      k: number of lookahead steps (default: 5)
      alpha: linear interpolation factor. 1.0 recovers the inner optimizer.
          (default: 5)
  
  Example:
      >>> import torch_optimizer as optim
      >>> yogi = optim.Yogi(model.parameters(), lr=0.1)
      >>> optimizer = optim.Lookahead(yogi, k=5, alpha=0.5)
      >>> optimizer.zero_grad()
      >>> loss_fn(model(input), target).backward()
      >>> optimizer.step()
  
  __ https://arxiv.org/abs/1907.08610
  
  Note:
      Reference code: https://github.com/alphadl/lookahead.pytorch
code: def _update(self, group: Dict[str, Any]) -> None:
      for fast in group["params"]:
          param_state = self.state[fast]
          if "slow_param" not in param_state:
              param_state["slow_param"] = torch.clone(
                  fast.data
              ).detach()
  
          slow = param_state["slow_param"]
          fast.data.mul_(self.alpha).add_(slow, alpha=1.0 - self.alpha)
          slow.data.copy_(fast)
  
file_path: pytorch-optimizer/torch_optimizer/lookahead.py
imports: from collections import defaultdict
  from typing import Any, Dict
  import torch
  from torch.optim.optimizer import Optimizer
  from .types import OptFloat, OptLossClosure, State
label_desc: Use image node_id 2 for calling the Lookahead obj's underlying member method code with example usage: obj._update(group) without return types