class_docstr: Dynamically adjusts the loss scaling factor.
  
  Dynamic loss scalers are important in mixed-precision training. They help
  us avoid underflows and overflows in low-precision gradients.
  
  See here for information:
  <https://docs.nvidia.com/deeplearning/performance/mixed-precision-training/index.html#lossscaling>
  
  Shamelessly stolen and adapted from Fairseq.
  <https://github.com/pytorch/fairseq/blob/main/fairseq/optim/fp16_optimizer.py>
class_docstr_tok: ["Dynamically","adjusts","the","loss","scaling","factor",".","Dynamic","loss","scalers","are","important","in","mixed-precision","training",".","They","help","us","avoid","underflows","and","overflows","in","low-precision","gradients",".","See","here","for","information",":","<","https",":","\/\/docs.nvidia.com\/deeplearning\/performance\/mixed-precision-training\/index.html","#","lossscaling",">","Shamelessly","stolen","and","adapted","from","Fairseq",".","<","https",":","\/\/github.com\/pytorch\/fairseq\/blob\/main\/fairseq\/optim\/fp16_optimizer.py",">"]
docstr: Decrease the loss scale by self.scale_factor.
  
  NOTE: the loss_scale will not go below self.threshold.
code: def _decrease_loss_scale(self):
      """
      Decrease the loss scale by self.scale_factor.
  
      NOTE: the loss_scale will not go below self.threshold.
      """
      self.loss_scale /= self.scale_factor
      if self.threshold is not None:
          self.loss_scale = max(self.loss_scale, self.threshold)
  
imports: import math
  from itertools import chain
  from typing import Optional
  import parlai.utils.logging
label_desc: Use image node_id 3 for calling the DynamicLossScaler obj's underlying member method code with example usage: obj._decrease_loss_scale() without return types