class_docstr: A callback that stores plots of the training and multiple validation losses curve every n epochs.
  
  Args:
      every_n_epochs: Specifies how often the plots are generated.
          Setting this to a large value can save time since plotting can be time consuming
          (especially when small datasets are used).
      dataset_names_val: The names of the datasets that the validation loss should be plotted for.
class_docstr_tok: ["A","callback","that","stores","plots","of","the","training","and","multiple","validation","losses","curve","every","n","epochs",".","Args",":","every_n_epochs",":","Specifies","how","often","the","plots","are","generated",".","Setting","this","to","a","large","value","can","save","time","since","plotting","can","be","time","consuming","(","especially","when","small","datasets","are","used",")",".","dataset_names_val",":","The","names","of","the","datasets","that","the","validation","loss","should","be","plotted","for","."]
code: def plot_loss(
      self, trainer: Trainer, pl_module: MetaLightningModule
  ) -> None:
      train_loss, train_steps = get_loss_steps("train_loss", trainer)
  
      fig, ax = plt.subplots()
      ax.semilogy(
          train_steps, train_loss, label="train_loss", alpha=0.5
      )
      for d_name in self.dataset_names_val:
          val_loss, val_steps = get_loss_steps(
              f"{d_name}_val_loss", trainer
          )
          ax.semilogy(val_steps, val_loss, label=f"{d_name}_val_loss")
  
      ticks = range(0, trainer.current_epoch + 1, self.every_n_epochs)
      labels = [str(t) for t in ticks]
      ax.set_xticks(ticks)
      ax.set_xticklabels(labels, rotation=45)
      ax.legend(loc="upper left")
  
      fig.savefig(
          get_save_dir_from_csvlogger(trainer.logger) / f"loss.png",
          bbox_inches="tight",
      )
      plt.close(fig)
  
imports: from typing import Optional, Union, List
  from pytorch_lightning import Callback, Trainer
  import matplotlib.pyplot
  from meta.data.batch import TripletBatch
  from meta.models.module import MetaLightningModule
  from .common import get_save_dir_from_csvlogger, get_loss_steps
  from meta.data.batch import SeriesBatch
  from meta.vis.forecast import plot_quantile_forecast, plot_forecast_supportset_attention
label_desc: Use image node_id 2 for calling the CheatLossPlotLoggerCallback obj's underlying member method code with example usage: obj.plot_loss(trainer, pl_module) without return types