class_docstr: WeightDecay callback which uses an L2 norm with the given rate and parameters. If params is None (default) then
  the parameters will be retrieved from the model.
  
  Example: ::
  
      >>> from torchbearer import Trial
      >>> from torchbearer.callbacks import L2WeightDecay
  
      # Example Trial which runs a trial with weight decay on the model using an L2 norm
      >>> decay = L2WeightDecay()
      >>> trial = Trial(None, callbacks=[decay], metrics=['loss'], verbose=2).for_steps(10).run(1)
  
  Args:
      rate (float): The decay rate or lambda
      params (Iterable[Tensor] or Tensor, optional): an iterable of Tensors or a
          single Tensor that will have gradients normalized, otherwise this is retrieved from state
  
  State Requirements:
      - :attr:`torchbearer.state.MODEL`: Model should have the `parameters` method
      - :attr:`torchbearer.state.LOSS`: Loss should be a tensor that can be incremented
code: def __init__(self, rate=5e-4, params=None):
      super(L2WeightDecay, self).__init__(rate=rate, p=2, params=params)
  
file_path: torchbearer/torchbearer/callbacks/weight_decay.py
imports: import torchbearer
  from torchbearer.callbacks import Callback
  import torch
label_desc: Use image node_id 1 to create a new L2WeightDecay object from inherited base classes: WeightDecay with example: obj = L2WeightDecay(rate, params)