class_docstr: Trigger based on a fixed interval.
  
  This trigger accepts iterations divided by a given interval. There are two
  ways to specify the interval: per iterations and epochs. `Iteration` means
  the number of updates, while `epoch` means the number of sweeps over the
  training dataset. Fractional values are allowed if the interval is a
  number of epochs; the trigger uses the `iteration` and `epoch_detail`
  attributes defined by the updater.
  
  For the description of triggers, see :func:`~chainer.training.get_trigger`.
  
  Args:
      period (int or float): Length of the interval. Must be an integer if
          unit is ``'iteration'``.
      unit (str): Unit of the length specified by ``period``. It must be
          either ``'iteration'`` or ``'epoch'``.
code: def __init__(self, period, unit):
      if unit not in ("epoch", "iteration"):
          raise ValueError(
              "Trigger unit must be either 'epoch' or 'iteration'."
          )
  
      self.period = period
      self.unit = unit
  
      self._previous_iteration = 0
      self._previous_epoch_detail = 0.0
  
      # count is kept for backward compatibility
      self.count = 0
  
file_path: chainer/chainer/training/triggers/interval_trigger.py
imports: import warnings
label_desc: Use image node_id 1 to create a new IntervalTrigger object from inherited base classes: object with example: obj = IntervalTrigger(period, unit)