class_docstr: Learning rate finder handler for supervised trainers.
  
  While attached, the handler increases the learning rate in between two
  boundaries in a linear or exponential manner. It provides valuable
  information on how well the network can be trained over a range of learning
  rates and what can be an optimal learning rate.
  
  Examples:
      .. code-block:: python
  
          from ignite.handlers import FastaiLRFinder
  
          trainer = ...
          model = ...
          optimizer = ...
  
          lr_finder = FastaiLRFinder()
          to_save = {"model": model, "optimizer": optimizer}
  
          with lr_finder.attach(trainer, to_save=to_save) as trainer_with_lr_finder:
              trainer_with_lr_finder.run(dataloader)
  
          # Get lr_finder results
          lr_finder.get_results()
  
          # Plot lr_finder results (requires matplotlib)
          lr_finder.plot()
  
          # get lr_finder suggestion for lr
          lr_finder.lr_suggestion()
  
  
  Note:
      When context manager is exited all LR finder's handlers are removed.
  
  Note:
      Please, also keep in mind that all other handlers attached the trainer will be executed during LR finder's run.
  
  Note:
      This class may require `matplotlib` package to be installed to plot learning rate range test:
  
      .. code-block:: bash
  
          pip install matplotlib
  
  
  References:
  
      Cyclical Learning Rates for Training Neural Networks:
      https://arxiv.org/abs/1506.01186
  
      fastai/lr_find: https://github.com/fastai/fastai
  
  .. versionadded:: 0.4.6
docstr: Applying the suggested learning rate(s) on the given optimizer.
  
  Args:
      optimizer: the optimizer to apply the suggested learning rate(s) on.
  
  Note:
      The given optimizer must be the same as the one we before found the suggested learning rate for.
docstr_tok: ["Applying","the","suggested","learning","rate","(","s",")","on","the","given","optimizer",".","Args",":","optimizer",":","the","optimizer","to","apply","the","suggested","learning","rate","(","s",")","on",".","Note",":","The","given","optimizer","must","be","the","same","as","the","one","we","before","found","the","suggested","learning","rate","for","."]
code: def apply_suggested_lr(self, optimizer: Optimizer) -> None:
      """
      Applying the suggested learning rate(s) on the given optimizer.
  
      Args:
          optimizer: the optimizer to apply the suggested learning rate(s) on.
  
      Note:
          The given optimizer must be the same as the one we before found the suggested learning rate for.
      """
      sug_lr = self.lr_suggestion()
      if not isinstance(sug_lr, list):
          sug_lr = [
              sug_lr,
          ]
  
      if len(sug_lr) != len(optimizer.param_groups):
          raise RuntimeError(
              "The number of parameter groups does not match between "
              "given optimizer and the one used for estimating the "
              f"learning rate: {len(sug_lr)} vs {len(optimizer.param_groups)}"
          )
  
      for i, lr in enumerate(sug_lr):
          optimizer.param_groups[i]["lr"] = lr
  
imports: import contextlib
  import logging
  import tempfile
  import warnings
  from math import ceil
  from pathlib import Path
  from typing import Any, Callable, Dict, List, Mapping, Optional, Union
  import torch
  from torch.optim import Optimizer
  from torch.optim.lr_scheduler import _LRScheduler
  import ignite.distributed
  from ignite.engine import Engine, Events
  from ignite.handlers import Checkpoint
  from ignite.handlers.param_scheduler import LRScheduler, ParamGroupScheduler, PiecewiseLinear
label_desc: Use image node_id 11 for calling the FastaiLRFinder obj's underlying member method code with example usage: obj.apply_suggested_lr(optimizer) without return types