class_docstr: Implements SGDW algorithm.
  
  It has been proposed in `Decoupled Weight Decay Regularization`__.
  
  Arguments:
      params: iterable of parameters to optimize or dicts defining
          parameter groups
      lr: learning rate (default: 1e-3)
      momentum: momentum factor (default: 0)
      weight_decay: weight decay (L2 penalty) (default: 0)
      dampening: dampening for momentum (default: 0)
      nesterov: enables Nesterov momentum (default: False)
  
  Example:
      >>> import torch_optimizer as optim
      >>> optimizer = optim.SGDW(model.parameters(), lr=0.1, momentum=0.9)
      >>> optimizer.zero_grad()
      >>> loss_fn(model(input), target).backward()
      >>> optimizer.step()
  
  __ https://arxiv.org/abs/1711.05101
  
  Note:
      Reference code: https://github.com/pytorch/pytorch/pull/22466
code: def __init__(
      self,
      params: Params,
      lr: float = 1e-3,
      momentum: float = 0.0,
      dampening: float = 0.0,
      weight_decay: float = 0.0,
      nesterov: bool = False,
  ) -> None:
      if lr <= 0.0:
          raise ValueError("Invalid learning rate: {}".format(lr))
      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.0:
          raise ValueError(
              "Invalid weight_decay value: {}".format(weight_decay)
          )
  
      defaults = dict(
          lr=lr,
          momentum=momentum,
          dampening=dampening,
          weight_decay=weight_decay,
          nesterov=nesterov,
      )
      if nesterov and (momentum <= 0 or dampening != 0):
          raise ValueError(
              "Nesterov momentum requires a momentum and zero dampening"
          )
      super(SGDW, self).__init__(params, defaults)
  
imports: import torch
  from torch.optim.optimizer import Optimizer
  from .types import OptFloat, OptLossClosure, Params, State
label_desc: Use image node_id 1 to create a new SGDW object from inherited base classes: Optimizer with example: obj = SGDW(params, lr, momentum, dampening, weight_decay, nesterov)