class_docstr: The S-Mixup from the `"Graph Mixup with Soft Alignments" <https://icml.cc/virtual/2023/poster/24930>`_ paper.
  
  Args:
      data_root_path (string): Directory where datasets are saved. 
      dataset (string): Dataset Name.
      conf (dict): Hyperparameters of the graph matching network which is used to compute the soft alignments.
class_docstr_tok: ["The","S-Mixup","from","the","`","``","Graph","Mixup","with","Soft","Alignments","''","<","https",":","\/\/icml.cc\/virtual\/2023\/poster\/24930",">","`","_","paper",".","Args",":","data_root_path","(","string",")",":","Directory","where","datasets","are","saved",".","dataset","(","string",")",":","Dataset","Name",".","conf","(","dict",")",":","Hyperparameters","of","the","graph","matching","network","which","is","used","to","compute","the","soft","alignments","."]
code: def train_GMNET(self, train_set):
      self.GMNET.cuda()
  
      train_set = TripleSet(train_set)
      train_loader = DataLoader(
          train_set,
          batch_size=self.GMNET_conf["bs"],
          shuffle=True,
          num_workers=8,
      )
      optimizer = optim.Adam(
          self.GMNET.parameters(),
          lr=self.GMNET_conf["lr"],
          weight_decay=1e-4,
      )
  
      for epoch in range(1, self.GMNET_conf["epochs"] + 1):
          print("====epoch {} ====".format(epoch))
          self.GMNET.train()
          train_loss = 0.0
          for data_batch in train_loader:
              anchor_data, pos_data, neg_data = data_batch
              anchor_data, pos_data, neg_data = (
                  anchor_data.cuda(),
                  pos_data.cuda(),
                  neg_data.cuda(),
              )
  
              optimizer.zero_grad()
  
              x_1, y = self.GMNET(
                  anchor_data, pos_data, pred_head=False
              )
              x_2, z = self.GMNET(
                  anchor_data, neg_data, pred_head=False
              )
  
              loss = triplet_loss(x_1, y, x_2, z)
              loss = torch.mean(loss)
              loss.backward()
              optimizer.step()
              train_loss += loss
  
          print(
              "Epoch [{}] Train_loss {}".format(
                  epoch, train_loss / len(train_loader)
              )
          )
  
      print("GMNET training done.")
      self.GMNET.eval()
  
imports: import torch
  import torch.nn.functional
  import torch.nn
  import torch.optim
  import time
  import numpy
  from dig.auggraph.method.SMixup.model.GCN import GCN
  from dig.auggraph.method.SMixup.model.GIN import GIN
  from dig.auggraph.method.SMixup.model.GraphMatching import GraphMatching
  from dig.auggraph.method.SMixup.utils.sinkhorn import Sinkhorn
  from dig.auggraph.method.SMixup.utils.utils import NormalizedDegree, triplet_loss
  from dig.auggraph.dataset.aug_dataset import TripleSet
  from torch_geometric.datasets import TUDataset
  from torch_geometric.utils import to_dense_adj, dense_to_sparse, degree
  import torch_geometric.transforms
  from torch_geometric.loader import DataLoader
  from torch_geometric.data import Batch, Data
  from torch.nn.functional import softmax
  from sklearn.model_selection import KFold, train_test_split
  from sklearn.metrics import accuracy_score
label_desc: Use image node_id 5 for calling the smixup obj's underlying member method code with example usage: obj.train_GMNET(train_set) without return types