class_docstr: PyTorch Lightning module for the meta models.
class_docstr_tok: ["PyTorch","Lightning","module","for","the","meta","models","."]
docstr: Example of how to use StepLR:
      {
          "scheduler": StepLR(optimizer, gamma=0.99, ...)
          interval": "epoch",
          "frequency": 1,
      }
docstr_tok: ["Example","of","how","to","use","StepLR",":","{","``","scheduler","''",":","StepLR","(","optimizer",",","gamma=0.99",",","...",")","interval","''",":","``","epoch","''",",","``","frequency","''",":","1",",","}"]
code: def configure_optimizers(self) -> Dict:
      """
      Example of how to use StepLR:
          {
              "scheduler": StepLR(optimizer, gamma=0.99, ...)
              interval": "epoch",
              "frequency": 1,
          }
      """
      optimizer = optim.Adam(self.parameters(), lr=self.lr)
  
      return {
          "optimizer": optimizer,
          "lr_scheduler": {
              "scheduler": ReduceLROnPlateau(
                  optimizer,
                  mode="min",
                  patience=self.lr_on_plateau_patience,
                  factor=self.lr_on_plateau_factor,
                  verbose=True,
              ),
              "monitor": self.lr_scheduler_monitor,
              "frequency": 1
              # If "monitor" references validation metrics, then "frequency" should be set to a
              # multiple of "trainer.check_val_every_n_epoch".
          },
      }
  
file_path: gluonts/src/gluonts/nursery/few_shot_prediction/src/meta/models/module.py
imports: from typing import Any, Dict, Optional, List
  import pytorch_lightning
  import torch
  import torch.optim
  from torch import nn
  from torchmetrics import Metric
  from torch.optim.lr_scheduler import ReduceLROnPlateau
  from meta.data.batch import TripletBatch
  from meta.models.model import MetaModel
  from meta.common.torch import get_mask
label_desc: Use image node_id 2 for calling the MetaLightningModule obj's underlying member method code with example usage: obj.configure_optimizers() and returns: dict