class_docstr: Plugin for LinearSchedulerWithWarmup.
class_docstr_tok: ["Plugin","for","LinearSchedulerWithWarmup","."]
docstr: Do the scheduler step if one-cycle or linear decay.
docstr_tok: ["Do","the","scheduler","step","if","one-cycle","or","linear","decay","."]
code: def after_training_batch(self, optimizer_was_run: bool, **kwargs):
      """Do the scheduler step if one-cycle or linear decay."""
      # skip if no optimization has happened.
      if not optimizer_was_run:
          return
      self.scheduler.step()
      self.store_learning_rate()
  
file_path: flair/flair/trainers/plugins/functional/linear_scheduler.py
imports: import logging
  from typing import Any, Dict
  from flair.optim import LinearSchedulerWithWarmup
  from flair.trainers.plugins.base import TrainerPlugin
label_desc: Use image node_id 5 for calling the LinearSchedulerPlugin obj's underlying member method code with example usage: obj.after_training_batch(optimizer_was_run) without return types