code: def add_weight_decay_supernet(
      model, args, weight_decay=1e-5, skip_list=()
  ):
      decay = []
      no_decay = []
      meta_layer_no_decay = []
      meta_layer_decay = []
      for name, param in model.named_parameters():
          if not param.requires_grad:
              continue  # frozen weights
          if (
              len(param.shape) == 1
              or name.endswith(".bias")
              or name in skip_list
          ):
              if "meta_layer" in name:
                  meta_layer_no_decay.append(param)
              else:
                  no_decay.append(param)
          else:
              if "meta_layer" in name:
                  meta_layer_decay.append(param)
              else:
                  decay.append(param)
      return [
          {"params": no_decay, "weight_decay": 0.0, "lr": args.lr},
          {
              "params": decay,
              "weight_decay": weight_decay,
              "lr": args.lr,
          },
          {
              "params": meta_layer_no_decay,
              "weight_decay": 0.0,
              "lr": args.meta_lr,
          },
          {
              "params": meta_layer_decay,
              "weight_decay": 0,
              "lr": args.meta_lr,
          },
      ]
  
file_path: nni/examples/nas/legacy/cream/lib/utils/util.py
imports: import sys
  import logging
  import torch
  import argparse
  import torch.nn
  from torch import optim
  from thop import profile, clever_format
  from timm.utils import *
  from lib.config import cfg
label_desc: Use image node_id 3 for calling a global function with example usage: add_weight_decay_supernet(model, args, weight_decay, skip_list) and returns: list