class_docstr: Applies regularizers to the parameters of a Module based on regex matches.
docstr: # Parameters
  
  module : `torch.nn.Module`, required
      The module to regularize.
code: def __call__(self, module: torch.nn.Module) -> torch.Tensor:
      """
      # Parameters
  
      module : `torch.nn.Module`, required
          The module to regularize.
      """
      accumulator = 0.0
      for name, parameter in module.named_parameters():
          # We first check if the parameter needs gradient updates or not
          if parameter.requires_grad:
              # For each parameter find the first matching regex.
              for regex, regularizer in self._regularizers:
                  if re.search(regex, name):
                      penalty = regularizer(parameter)
                      accumulator = accumulator + penalty
                      break
      return accumulator
  
file_path: allennlp/allennlp/nn/regularizers/regularizer_applicator.py
imports: import re
  from typing import List, Tuple
  import torch
  from allennlp.common import FromParams
  from allennlp.nn.regularizers.regularizer import Regularizer
label_desc: Use image node_id 2 for calling the RegularizerApplicator obj's underlying member method code with example usage: obj.__call__(module) and returns: accumulator