class_docstr: Base class for noise multiplier schedulers. We follow the same API
  as the standard PyTorch LR schedulers, but apply them to Opacus's noise
  multiplier param instead.
  
  This means it only works when you pass a opacus.DPOptimizer, since that
  will have a `noise_multiplier` attribute.
class_docstr_tok: ["Base","class","for","noise","multiplier","schedulers",".","We","follow","the","same","API","as","the","standard","PyTorch","LR","schedulers",",","but","apply","them","to","Opacus","'s","noise","multiplier","param","instead",".","This","means","it","only","works","when","you","pass","a","opacus.DPOptimizer",",","since","that","will","have","a","`","noise_multiplier","`","attribute","."]
docstr: Args:
      optimizer (DPOptimizer): The DPOptimizer
      *: Any other positional args (this is an abstract base class)
      last_epoch(int): The index of last epoch. Default: -1.
docstr_tok: ["Args",":","optimizer","(","DPOptimizer",")",":","The","DPOptimizer","*",":","Any","other","positional","args","(","this","is","an","abstract","base","class",")","last_epoch","(","int",")",":","The","index","of","last","epoch",".","Default",":","-1","."]
code: def __init__(self, optimizer: DPOptimizer, *, last_epoch=-1):
      """
      Args:
          optimizer (DPOptimizer): The DPOptimizer
          *: Any other positional args (this is an abstract base class)
          last_epoch(int): The index of last epoch. Default: -1.
      """
      if not hasattr(optimizer, "noise_multiplier"):
          raise ValueError(
              "NoiseSchedulers require your optimizer to have a .noise_multiplier attr. "
              "Are you sure you are using a DPOptimizer? Those have it added for you."
          )
      self.optimizer = optimizer
      self.last_epoch = last_epoch
  
      self.step()
  
file_path: opacus/opacus/schedulers/noise_scheduler.py
imports: from typing import Callable, Dict
  from opacus.optimizers import DPOptimizer
label_desc: Use image node_id 1 to create a new _NoiseScheduler object  with example: obj = _NoiseScheduler(optimizer)