docstr: Saves the model each k epochs.
docstr_tok: ["Saves","the","model","each","k","epochs","."]
code: def after_training_epoch(self, epoch, **kw):
      """Saves the model each k epochs."""
      if (
          self.save_model_each_k_epochs > 0
          and epoch % self.save_model_each_k_epochs == 0
      ):
          log.info(
              f"Saving model at current epoch since 'save_model_each_k_epochs={self.save_model_each_k_epochs}' "
              f"was set"
          )
          model_name = "model_epoch_" + str(epoch) + ".pt"
          self.model.save(
              self.base_path / model_name,
              checkpoint=self.save_optimizer_state,
          )
  
file_path: flair/flair/trainers/plugins/functional/checkpoints.py
imports: import logging
  from typing import Any, Dict
  from flair.trainers.plugins.base import TrainerPlugin
label_desc: Use image node_id 2 for calling the CheckpointPlugin obj's underlying member method code with example usage: obj.after_training_epoch(epoch) without return types