code: def _assign_regularized_params(
      regularized_param_list=None,
      unregularized_param_list=None,
      parameters_to_unregularize=None,
  ):
      """
      Takes a list parameters_to_unregularize (a list of parameters to ensure are
      not regularized) and compares it to regularized_param_list, a list of
      regularized parameters. Any parameters in parameters_to_unregularize that
      are present in regularized_param_list are removed from
      regularized_param_list. Will also check against an optional
      unregularized_param_list (pre-existing list of parameters not to regularize)
      and remove any items from parameters_to_unregularize that are in
      unregularized_param_list. Used for when we have parameters that we don't
      want to regularize (e.g. the class token and position embeddings for the
      vision transformer). See config.OPTIMIZER.non_regularized_params. Needs
      to be called separately for head, trunk, and remaining params.
      """
      indices_to_remove_from_regularized = []
      indices_to_remove_from_new_unregularized = []
  
      # Iterate through new parameters to unregularize
      for unreg_param_ind, new_unreg_param in enumerate(
          parameters_to_unregularize
      ):
          # Iterate through list of regularized parameters
          for reg_param_ind, reg_param in enumerate(
              regularized_param_list
          ):
              # Note any matches
              if reg_param is new_unreg_param:
                  indices_to_remove_from_regularized.append(
                      reg_param_ind
                  )
          if unregularized_param_list:
              # Iterate through pre-existing list of unregularized parameters
              for unreg_param in unregularized_param_list:
                  # Note any matches
                  if unreg_param is new_unreg_param:
                      indices_to_remove_from_new_unregularized.append(
                          unreg_param_ind
                      )
  
      # Iterate through indices to remove from list regularized params and
      # remove them
      indices_to_remove_from_regularized.sort(reverse=True)
      for i in indices_to_remove_from_regularized:
          del regularized_param_list[i]
      if unregularized_param_list:
          indices_to_remove_from_new_unregularized.sort(reverse=True)
          # Iterate through indices to remove from new list of unregularized
          # parameters
          for i in indices_to_remove_from_new_unregularized:
              del parameters_to_unregularize[i]
      return (
          parameters_to_unregularize,
          regularized_param_list,
          unregularized_param_list,
      )
  
file_path: vissl/vissl/optimizers/param_groups/default.py
imports: import logging
  from typing import Any, Dict, List
  import torch.nn
  from fvcore.common.param_scheduler import ParamScheduler
  from vissl.config import AttrDict
  from vissl.optimizers.param_groups.registry import register_param_group_constructor
  from vissl.utils.misc import is_apex_available
label_desc: Use image node_id 3 for calling a global function with example usage: _assign_regularized_params(regularized_param_list, unregularized_param_list, parameters_to_unregularize) and returns: parameters_to_unregularize,  regularized_param_list,  unregularized_param_list