class_docstr: Trainer extension to shift an optimizer attribute magically by Vaswani.
  
  Args:
      attr (str): Name of the attribute to shift.
      rate (float): Rate of the exponential shift. This value is multiplied
          to the attribute at each call.
      init (float): Initial value of the attribute. If it is ``None``, the
          extension extracts the attribute at the first call and uses it as
          the initial value.
      target (float): Target value of the attribute. If the attribute reaches
          this value, the shift stops.
      optimizer (~chainer.Optimizer): Target optimizer to adjust the
          attribute. If it is ``None``, the main optimizer of the updater is
          used.
docstr: Initialize Optimizer values.
docstr_tok: ["Initialize","Optimizer","values","."]
code: def initialize(self, trainer):
      """Initialize Optimizer values."""
      optimizer = self._get_optimizer(trainer)
      # ensure that _init is set
      if self._init is None:
          self._init = self._d_inv05 * (1.0 * self._warmup_steps_inv15)
      if self._last_value is not None:  # resuming from a snapshot
          self._update_value(optimizer, self._last_value)
      else:
          self._update_value(optimizer, self._init)
  
imports: import collections
  import logging
  import math
  import numpy
  from chainer import cuda
  from chainer import functions
  from chainer import training
  from chainer.training import extension
  from chainer.training.updaters.multiprocess_parallel_updater import gather_grads, gather_params, scatter_grads
label_desc: Use image node_id 2 for calling the VaswaniRule obj's underlying member method code with example usage: obj.initialize(trainer) without return types