class_docstr: Base class for models.
code: def get_optimizer_params(self, weight_decay, lr_scale=1):
      p_wd, p_non_wd = [], []
      for n, p in self.named_parameters():
          if not p.requires_grad:
              continue  # frozen weights
          if p.ndim < 2 or "bias" in n or "ln" in n or "bn" in n:
              p_non_wd.append(p)
          else:
              p_wd.append(p)
      optim_params = [
          {
              "params": p_wd,
              "weight_decay": weight_decay,
              "lr_scale": lr_scale,
          },
          {"params": p_non_wd, "weight_decay": 0, "lr_scale": lr_scale},
      ]
      return optim_params
  
imports: import logging
  import os
  import numpy
  import torch
  import torch.nn
  from lavis.common.dist_utils import download_cached_file, is_dist_avail_and_initialized
  from lavis.common.utils import get_abs_path, is_url
  from omegaconf import OmegaConf
label_desc: Use image node_id 8 for calling the BaseModel obj's underlying member method code with example usage: obj.get_optimizer_params(weight_decay, lr_scale) and returns: optim_params