class_docstr: A callback that you can pass to the `GradientDescentTrainer` to change the frequency of
  validation during training. If `validation_start` is not `None`, validation will not occur until
  `validation_start` epochs have elapsed. If `validation_interval` is not `None`, validation will
  run every `validation_interval` number of epochs epochs.
code: def on_epoch(
      self,
      trainer: "GradientDescentTrainer",
      metrics: Dict[str, Any],
      epoch: int,
      is_primary: bool = True,
      **kwargs,
  ) -> None:
      trainer._should_validate_this_epoch = self._should_validate(
          epoch=epoch + 1
      )
  
file_path: allennlp/allennlp/training/callbacks/should_validate.py
imports: from typing import Dict, Any, TYPE_CHECKING, Optional
  from allennlp.training.callbacks.callback import TrainerCallback
label_desc: Use image node_id 3 for calling the ShouldValidateCallback obj's underlying member method code with example usage: obj.on_epoch(trainer, metrics, epoch, is_primary) without return types