class_docstr: Encapsulates model + loss + optimizer + metrics in a PL module
class_docstr_tok: ["Encapsulates","model","+","loss","+","optimizer","+","metrics","in","a","PL","module"]
code: def configure_optimizers(
      self,
  ) -> Union[
      torch.optim.Optimizer,  # Single optimizer
      Tuple[
          torch.optim.Optimizer, torch.optim.Optimizer
      ],  # Tuple or list of optim
      List[torch.optim.Optimizer],
      dict,  # "optimizer" key, and (optionally) an "lr_scheduler"
      Any,  # 2 lists: first with optimizers, second has LR schedulers; or Tuple[Dict]
  ]:
      # PL allows return type to be tuple/list/dict/two lists/tuple of dicts/None
      model_params = (
          p
          for n, p in self.named_parameters()
          if not n.endswith(".quantiles") and p.requires_grad
      )
  
      base_optim = hydra.utils.instantiate(
          self.cfg_optim, params=model_params
      )
      base_scheduler = hydra.utils.instantiate(
          self.cfg_scheduler, optimizer=base_optim
      )
      scheduler = {
          "scheduler": base_scheduler,
          "interval": "step",
          "frequency": self.lr_annealing_frequency,
      }
      return {"optimizer": base_optim, "lr_scheduler": scheduler}
  
imports: from typing import Any, List, Optional, Tuple, Union
  import hydra
  import pytorch_lightning
  import torch
  import torch.nn.functional
  from datamodules.video_data_api import VideoData
  from model_pipeline import VCTPipeline
  from omegaconf import DictConfig
  from torch import Tensor
  from torchmetrics.functional import peak_signal_noise_ratio
  from utils.hydra_tools import OmegaConf
label_desc: Use image node_id 7 for calling the VCTModule obj's underlying member method code with example usage: obj.configure_optimizers() and returns: dict