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 serialize(self, serializer):
      try:
          self._previous_iteration = serializer(
              "previous_iteration", self._previous_iteration
          )
      except KeyError:
          warnings.warn(
              "The previous value of iteration is not saved. "
              "IntervalTrigger guesses it using current iteration. "
              "If this trigger is not called at every iteration, "
              "it may not work correctly."
          )
          # set a negative value for invalid
          self._previous_iteration = -1
  
      try:
          self._previous_epoch_detail = serializer(
              "previous_epoch_detail", self._previous_epoch_detail
          )
      except KeyError:
          warnings.warn(
              "The previous value of epoch_detail is not saved. "
              "IntervalTrigger uses the value of "
              "trainer.updater.previous_epoch_detail. "
              "If this trigger is not called at every iteration, "
              "it may not work correctly."
          )
          # set a negative value for invalid
          self._previous_epoch_detail = -1.0
  
file_path: chainer/chainer/training/triggers/interval_trigger.py
imports: import warnings
label_desc: Use image node_id 3 for calling the IntervalTrigger obj's underlying member method code with example usage: obj.serialize(serializer) without return types