class_docstr: Implements PID optimization algorithm.
  
  It has been proposed in `A PID Controller Approach for Stochastic
  Optimization of Deep Networks`__.
  
  Arguments:
      params: iterable of parameters to optimize or dicts defining
          parameter groups
      lr: learning rate (default: 1e-3)
      momentum: momentum factor (default: 0.0)
      weight_decay: weight decay (L2 penalty) (default: 0.0)
      dampening: dampening for momentum (default: 0.0)
      derivative: D part of the PID (default: 10.0)
      integral: I part of the PID (default: 5.0)
  
  Example:
      >>> import torch_optimizer as optim
      >>> optimizer = optim.PID(model.parameters(), lr=0.001, momentum=0.1)
      >>> optimizer.zero_grad()
      >>> loss_fn(model(input), target).backward()
      >>> optimizer.step()
  
  __ http://www4.comp.polyu.edu.hk/~cslzhang/paper/CVPR18_PID.pdf
  
  Note:
      Reference code: https://github.com/tensorboy/PIDOptimizer
code: def __init__(
      self,
      params: Params,
      lr: float = 1e-3,
      momentum: float = 0.0,
      dampening: float = 0,
      weight_decay: float = 0.0,
      integral: float = 5.0,
      derivative: float = 10.0,
  ) -> None:
      defaults = dict(
          lr=lr,
          momentum=momentum,
          dampening=dampening,
          weight_decay=weight_decay,
          integral=integral,
          derivative=derivative,
      )
      if lr <= 0.0:
          raise ValueError("Invalid learning rate: {}".format(lr))
      if momentum < 0.0:
          raise ValueError(
              "Invalid momentum value: {}".format(momentum)
          )
      if weight_decay < 0.0:
          raise ValueError(
              "Invalid weight_decay value: {}".format(weight_decay)
          )
      if integral < 0.0:
          raise ValueError(
              "Invalid PID integral value: {}".format(integral)
          )
      if derivative < 0.0:
          raise ValueError(
              "Invalid PID derivative value: {}".format(derivative)
          )
  
      super(PID, self).__init__(params, defaults)
  
imports: import torch
  from torch.optim.optimizer import Optimizer
  from .types import OptFloat, OptLossClosure, Params
label_desc: Use image node_id 1 to create a new PID object from inherited base classes: Optimizer with example: obj = PID(params, lr, momentum, dampening, weight_decay, integral, derivative)