class_docstr: This class enables adjusting the momentum in batch normalization layer.
  
  .. note::
      It's an experimental feature and should be used with caution.
code: def __init__(self, opts, *args, **kwargs):
      self.is_iteration_based = getattr(
          opts, "scheduler.is_iteration_based", True
      )
      self.warmup_iterations = getattr(
          opts, "scheduler.warmup_iterations", 10000
      )
  
      if self.is_iteration_based:
          self.max_steps = getattr(
              opts, "scheduler.max_iterations", 100000
          )
          self.max_steps -= self.warmup_iterations
          assert self.max_steps > 0
      else:
          logger.warning(
              "Running {} for epoch-based methods. Not yet validation.".format(
                  self.__class__.__name__
              )
          )
          self.max_steps = getattr(opts, "scheduler.max_epochs", 100)
  
      self.momentum = getattr(opts, "model.normalization.momentum", 0.1)
      self.min_momentum = getattr(
          opts,
          "model.normalization.adjust_bn_momentum.final_momentum_value",
          1e-6,
      )
  
      if self.min_momentum >= self.momentum:
          logger.error(
              "Min. momentum value in {} should be <= momentum. Got {} and {}".format(
                  self.__class__.__name__,
                  self.min_momentum,
                  self.momentum,
              )
          )
  
      anneal_method = getattr(
          opts,
          "model.normalization.adjust_bn_momentum.anneal_type",
          "cosine",
      )
      if anneal_method is None:
          logger.warning(
              "Annealing method in {} is None. Setting to cosine".format(
                  self.__class__.__name__
              )
          )
          anneal_method = "cosine"
  
      anneal_method = anneal_method.lower()
  
      if anneal_method == "cosine":
          self.anneal_fn = self._cosine
      elif anneal_method == "linear":
          self.anneal_fn = self._linear
      else:
          raise RuntimeError(
              "Anneal method ({}) not yet implemented".format(
                  anneal_method
              )
          )
      self.anneal_method = anneal_method
  
file_path: ml-cvnets/cvnets/layers/normalization_layers.py
imports: import math
  from torch import nn
  from cvnets.layers.normalization import NORM_LAYER_CLS, build_normalization_layer
  from utils import logger
label_desc: Use image node_id 1 to create a new AdjustBatchNormMomentum object from inherited base classes: object with example: obj = AdjustBatchNormMomentum(opts)