class_docstr: Special callback used by the learning rate finder. This callback logs the learning rate before each batch and
  logs the corresponding loss after each batch.
  
  Args:
      num_training: number of iterations done by the learning rate finder
      early_stop_threshold: threshold for stopping the search. If the
          loss at any point is larger than ``early_stop_threshold*best_loss``
          then the search is stopped. To disable, set to ``None``.
      progress_bar_refresh_rate: rate to refresh the progress bar for
          the learning rate finder
      beta: smoothing value, the loss being logged is a running average of
          loss values logged until now. ``beta`` controls the forget rate i.e.
          if ``beta=0`` all past information is ignored.
code: def __init__(
      self,
      num_training: int,
      early_stop_threshold: Optional[float] = 4.0,
      progress_bar_refresh_rate: int = 0,
      beta: float = 0.98,
  ):
      self.num_training = num_training
      self.early_stop_threshold = early_stop_threshold
      self.beta = beta
      self.losses: List[float] = []
      self.lrs: List[float] = []
      self.avg_loss = 0.0
      self.best_loss = 0.0
      self.progress_bar_refresh_rate = progress_bar_refresh_rate
      self.progress_bar = None
  
imports: import importlib
  import logging
  import os
  import uuid
  from copy import deepcopy
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union, cast
  import torch
  from lightning_utilities.core.imports import RequirementCache
  from typing_extensions import override
  import lightning.pytorch
  from lightning.fabric.utilities.types import _TORCH_LRSCHEDULER
  from lightning.pytorch.callbacks import Callback
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.parsing import lightning_hasattr, lightning_setattr
  from lightning.pytorch.utilities.rank_zero import rank_zero_warn
  from lightning.pytorch.utilities.types import STEP_OUTPUT, LRScheduler, LRSchedulerConfig
label_desc: Use image node_id 1 to create a new _LRCallback object from inherited base classes: Callback with example: obj = _LRCallback(num_training, early_stop_threshold, progress_bar_refresh_rate, beta)