class_docstr: Container class to run and log the change of distance ratios
  between intra-class distances and inter-class distances.
class_docstr_tok: ["Container","class","to","run","and","log","the","change","of","distance","ratios","between","intra-class","distances","and","inter-class","distances","."]
docstr: Args:
      checkdata: PyTorch DataLoader, data to check distance progression.
      opt:       argparse.Namespace, contains all training-specific parameters.
      name:      str, Name of instance. Important for savenames.
      update_epochs:  int, Only compute distance ratios every said epoch.
  Returns:
      Nothing!
docstr_tok: ["Args",":","checkdata",":","PyTorch","DataLoader",",","data","to","check","distance","progression",".","opt",":","argparse.Namespace",",","contains","all","training-specific","parameters",".","name",":","str",",","Name","of","instance",".","Important","for","savenames",".","update_epochs",":","int",",","Only","compute","distance","ratios","every","said","epoch",".","Returns",":","Nothing","!"]
code: def __init__(self, checkdata, opt, name="Train", update_epochs=1):
      """
      Args:
          checkdata: PyTorch DataLoader, data to check distance progression.
          opt:       argparse.Namespace, contains all training-specific parameters.
          name:      str, Name of instance. Important for savenames.
          update_epochs:  int, Only compute distance ratios every said epoch.
      Returns:
          Nothing!
      """
      self.update_epochs = update_epochs
      self.pars = opt
      self.save_path = opt.save_path
  
      self.name = name
      self.csv_file = (
          opt.save_path + "/distance_measures_{}.csv".format(self.name)
      )
      with open(self.csv_file, "a") as csv_file:
          writer = csv.writer(csv_file, delimiter=",")
          writer.writerow(["Rel. Intra/Inter Distance"])
  
      self.checkdata = checkdata
  
      self.mean_class_dists = []
      self.epochs = []
  
imports: import warnings
  import csv
  import pickle
  import time
  import auxiliaries
  import matplotlib.pyplot
  import numpy
  import torch
  import torch.multiprocessing
  import torch.nn
  from scipy.spatial import distance
  from sklearn.preprocessing import normalize
  from tqdm import tqdm
label_desc: Use image node_id 1 to create a new DistanceMeasure object  with example: obj = DistanceMeasure(checkdata, opt, name, update_epochs)