code: def regularization(model: nn.Module, mode: str):
      regu, counter = 0, 0
      for name, param in model.named_parameters():
          if "mask_scores" in name:
              if mode == "l1":
                  regu += (
                      torch.norm(torch.sigmoid(param), p=1)
                      / param.numel()
                  )
              elif mode == "l0":
                  regu += (
                      torch.sigmoid(
                          param - 2 / 3 * np.log(0.1 / 1.1)
                      ).sum()
                      / param.numel()
                  )
              else:
                  ValueError("Don't know this mode.")
              counter += 1
      return regu / counter
  
imports: import argparse
  import glob
  import json
  import logging
  import os
  import random
  import numpy
  import torch
  from torch import nn
  from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset
  from torch.utils.data.distributed import DistributedSampler
  from tqdm import tqdm, trange
  from emmental import MaskedBertConfig, MaskedBertForSequenceClassification
  from transformers import WEIGHTS_NAME, AdamW, BertConfig, BertForSequenceClassification, BertTokenizer, get_linear_schedule_with_warmup
  from transformers import glue_compute_metrics
  from transformers import glue_convert_examples_to_features
  from transformers import glue_output_modes
  from transformers import glue_processors
label_desc: Use image node_id 3 for calling a global function with example usage: regularization(model, mode) and returns: unknown