class_docstr: :class:`~opacus.optimizers.optimizer.DPOptimizer` that implements
  adaptive clipping strategy
  https://arxiv.org/pdf/1905.03871.pdf
class_docstr_tok: [":","class",":","`","~opacus.optimizers.optimizer.DPOptimizer","`","that","implements","adaptive","clipping","strategy","https",":","\/\/arxiv.org\/pdf\/1905.03871.pdf"]
docstr: Update clipping bound based on unclipped fraction
docstr_tok: ["Update","clipping","bound","based","on","unclipped","fraction"]
code: def update_max_grad_norm(self):
      """
      Update clipping bound based on unclipped fraction
      """
      unclipped_frac = self.unclipped_num / self.sample_size
      self.max_grad_norm *= torch.exp(
          -self.clipbound_learning_rate
          * (unclipped_frac - self.target_unclipped_quantile)
      )
      if self.max_grad_norm > self.max_clipbound:
          self.max_grad_norm = self.max_clipbound
      elif self.max_grad_norm < self.min_clipbound:
          self.max_grad_norm = self.min_clipbound
  
file_path: opacus/opacus/optimizers/adaclipoptimizer.py
imports: from __future__ import annotations
  import logging
  from typing import Callable, Optional
  import torch
  from opt_einsum import contract
  from torch.optim import Optimizer
  from .optimizer import DPOptimizer, _check_processed_flag, _generate_noise, _mark_as_processed
label_desc: Use image node_id 5 for calling the AdaClipDPOptimizer obj's underlying member method code with example usage: obj.update_max_grad_norm() without return types