code: def match_parameters(model, patterns):
      """Returns an generator over module parameters if name matches key
  
      It is useful to group parameters, and apply different functions to different group. This function provides an easy
      way to group them.
  
      Args:
          model: A Module
          patterns: A list of strings that will be used to match parameter names. If parameter name contains any pattern,
              it will be yield
  
      Yields:
          param: Module parameters
      """
      for name, param in model.named_parameters():
          for pattern in patterns:
              if re.search(pattern, name):
                  yield param
  
imports: import re
  import logging
label_desc: Use image node_id 1 for calling a global function with example usage: match_parameters(model, patterns) without return types