code: def _get_params_for_optimizer(self, prefix, named_parameters):
          
          kwargs = self._get_params_for(prefix)
          params = list(named_parameters)
          pgroups = []
  
          for pattern, group in kwargs.pop('param_groups', []):
              matches = [i for i, (name, _) in enumerate(params) if
                         fnmatch.fnmatch(name, pattern)]
              if matches:
                  p = [params.pop(i)[1] for i in reversed(matches)]
                  pgroups.append({'params': p, **group})
  
          if params:
              pgroups.append({'params': [p for _, p in params]})
  
          return [pgroups], kwargs
docs: Parse kwargs configuration for the optimizer identified by
          the given prefix. Supports param group assignment using wildcards:
  
              optimizer__lr=0.05,
              optimizer__param_groups=[
                  ('rnn*.period', {'lr': 0.3, 'momentum': 0}),
                  ('rnn0', {'lr': 0.1}),
              ]
  
          The first positional argument are the param groups.