code: def __init__(
      self,
      criterion: Type[nn.Module],
      metrics: Dict[str, torchmetrics.Metric],
      learning_rate: float = 0.001,
      weight_decay: float = 0.0,
      optimizer: Type[optim.Optimizer] = optim.Adam,
      export_onnx: Union[Path, str, bool, None] = None,
  ):
      super().__init__()
      self.save_hyperparameters(
          "criterion", "optimizer", "learning_rate", "weight_decay"
      )
      self.criterion = criterion()
      self.optimizer = optimizer
      self.metrics = nn.ModuleDict(metrics)
  
      if export_onnx is None or export_onnx is True:
          self.export_onnx = (
              Path(os.environ.get("NNI_OUTPUT_DIR", ".")) / "model.onnx"
          )
      elif export_onnx:
          self.export_onnx = Path(export_onnx)
      else:
          self.export_onnx = None
  
imports: import logging
  import os
  import warnings
  from pathlib import Path
  from typing import Any, Dict, Union, Optional, List, Type
  import pytorch_lightning
  import torch.nn
  import torch.nn.functional
  import torch.optim
  import torchmetrics
  import torchmetrics.classification
  import torch.utils.data
  import nni
  from nni.common.serializer import is_traceable
  from nni.nas.evaluator import MutableEvaluator
label_desc: Use image node_id 1 to create a new SupervisedLearningModule object from inherited base classes: LightningModule with example: obj = SupervisedLearningModule(criterion, metrics, learning_rate, weight_decay, optimizer, export_onnx)