class_docstr: Adagrad algorithm with custom gradient clipping
class_docstr_tok: ["Adagrad","algorithm","with","custom","gradient","clipping"]
code: def __init__(
      self,
      params,
      lr=1e-2,
      lr_decay=0,
      weight_decay=0,
      initial_accumulator_value=0,
      grad_clip=0,
  ):
      Adagrad.__init__(
          self,
          params,
          lr=lr,
          lr_decay=lr_decay,
          weight_decay=weight_decay,
          initial_accumulator_value=initial_accumulator_value,
      )
      self.defaults["grad_clip"] = grad_clip
      self.param_groups[0].setdefault("grad_clip", grad_clip)
  
file_path: fairseq/examples/adaptive_span/adagrad_with_grad_clip.py
imports: from torch.optim import Adagrad
  from fairseq.optim import LegacyFairseqOptimizer, register_optimizer
label_desc: Use image node_id 1 to create a new AdagradWithGradClip object from inherited base classes: Adagrad with example: obj = AdagradWithGradClip(params, lr, lr_decay, weight_decay, initial_accumulator_value, grad_clip)