class_docstr: Plugin for annealing logic in Flair.
class_docstr_tok: ["Plugin","for","annealing","logic","in","Flair","."]
docstr: Initialize different schedulers, including anneal target for AnnealOnPlateau, batch_growth_annealing, loading schedulers.
docstr_tok: ["Initialize","different","schedulers",",","including","anneal","target","for","AnnealOnPlateau",",","batch_growth_annealing",",","loading","schedulers","."]
code: def after_setup(
      self,
      train_with_dev,
      optimizer,
      **kw,
  ):
      """Initialize different schedulers, including anneal target for AnnealOnPlateau, batch_growth_annealing, loading schedulers."""
      # minimize training loss if training with dev data, else maximize dev score
      anneal_mode = "min" if train_with_dev else "max"
  
      # instantiate the scheduler
      self.scheduler: AnnealOnPlateau = AnnealOnPlateau(
          factor=self.anneal_factor,
          patience=self.patience,
          initial_extra_patience=self.initial_extra_patience,
          mode=anneal_mode,
          verbose=False,
          optimizer=self.trainer.optimizer,
      )
  
      self.store_learning_rate()
  
file_path: flair/flair/trainers/plugins/functional/anneal_on_plateau.py
imports: import logging
  import os
  from typing import Any, Dict
  from flair.trainers.plugins.base import TrainerPlugin, TrainingInterrupt
  from flair.trainers.plugins.metric_records import MetricRecord
  from flair.training_utils import AnnealOnPlateau
label_desc: Use image node_id 3 for calling the AnnealingPlugin obj's underlying member method code with example usage: obj.after_setup(train_with_dev, optimizer) without return types