class_docstr: Implements SGDP algorithm.
  
  It has been proposed in `Slowing Down the Weight Norm Increase in
  Momentum-based Optimizers`__
  
  Arguments:
      params: iterable of parameters to optimize or dicts defining
          parameter groups
      lr: learning rate (default: 1e-3)
      momentum: momentum factor (default: 0)
      dampening: dampening for momentum (default: 0)
      eps: term added to the denominator to improve
          numerical stability (default: 1e-8)
      weight_decay: weight decay (L2 penalty) (default: 0)
      delta: threhold that determines whether a set of parameters is scale
          invariant or not (default: 0.1)
      wd_ratio: relative weight decay applied on scale-invariant parameters
          compared to that applied on scale-variant parameters (default: 0.1)
      nesterov: enables Nesterov momentum (default: False)
  
  
  Example:
      >>> import torch_optimizer as optim
      >>> optimizer = optim.SGDP(model.parameters(), lr=0.1)
      >>> optimizer.zero_grad()
      >>> loss_fn(model(input), target).backward()
      >>> optimizer.step()
  
   __ https://arxiv.org/abs/2006.08217
  
  Note:
      Reference code: https://github.com/clovaai/AdamP
code: def __init__(
      self,
      params: Params,
      lr: float = 1e-3,
      momentum: float = 0,
      dampening: float = 0,
      eps: float = 1e-8,
      weight_decay: float = 0,
      delta: float = 0.1,
      wd_ratio: float = 0.1,
      nesterov: bool = False,
  ) -> None:
      if lr <= 0.0:
          raise ValueError("Invalid learning rate: {}".format(lr))
      if eps < 0.0:
          raise ValueError("Invalid epsilon value: {}".format(eps))
      if momentum < 0.0:
          raise ValueError(
              "Invalid momentum value: {}".format(momentum)
          )
      if dampening < 0.0:
          raise ValueError(
              "Invalid dampening value: {}".format(dampening)
          )
      if weight_decay < 0:
          raise ValueError(
              "Invalid weight_decay value: {}".format(weight_decay)
          )
      if delta < 0:
          raise ValueError("Invalid delta value: {}".format(delta))
      if wd_ratio < 0:
          raise ValueError(
              "Invalid wd_ratio value: {}".format(wd_ratio)
          )
  
      defaults = dict(
          lr=lr,
          momentum=momentum,
          dampening=dampening,
          eps=eps,
          weight_decay=weight_decay,
          delta=delta,
          wd_ratio=wd_ratio,
          nesterov=nesterov,
      )
      super(SGDP, self).__init__(params, defaults)
  
file_path: pytorch-optimizer/torch_optimizer/sgdp.py
imports: import math
  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 SGDP object from inherited base classes: Optimizer with example: obj = SGDP(params, lr, momentum, dampening, eps, weight_decay, delta, wd_ratio, nesterov)