code: def _setup_training(self, loss_fn=None, lr=1e-3, momentum=0.9):
      self.device = "cuda" if torch.cuda.is_available() else "cpu"
      self.model.to(self.device)
      if loss_fn is None:
          loss_fn = CrossEntropyLoss()
      else:
          loss_fn = CRITERION_FNS.get(loss_fn, CrossEntropyLoss())
      self.criterion = loss_fn
      self.optimizer = SGD(
          self.model.parameters(), lr=lr, momentum=momentum
      )
  
imports: import json
  import logging
  import os.path
  from pathlib import Path
  from tempfile import TemporaryDirectory
  from typing import Tuple, List, Any, Dict
  import torch
  from sparseml.onnx.optim import ModelAnalyzer, pruning_loss_sens_magnitude
  from sparseml.pytorch.optim import ScheduledModifierManager
  from sparseml.pytorch.sparsification import EpochRangeModifier, GMPruningModifier
  from sparseml.pytorch.utils import ModuleExporter
  from sparsify.blueprints.utils import default_epochs_distribution, PruningModelEvaluator, default_pruning_settings
  from sparsify.schemas import ProjectModelAnalysisSchema
  from torch.nn import CrossEntropyLoss, MSELoss
  from torch.optim import SGD
  from tqdm.auto import tqdm
label_desc: Use image node_id 2 for calling the PruningTrainer obj's underlying member method code with example usage: obj._setup_training(loss_fn, lr, momentum) without return types