class_docstr: This class implements the mixup algorithm [1] for natural language processing.
  
  [1] Zhang, Hongyi, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. "mixup: Beyond empirical risk
  minimization." in International Conference on Learning Representations (2018).
  https://openreview.net/forum?id=r1Ddp1-Rb
docstr: This method performs mixup. If runs = 1 it just does 1 mixup with whole batch, any n of runs
  creates many mixup matches.
  
  :type x: Numpy array
  :param x: Data array
  :type y: Numpy array
  :param y: (optional) labels
  :type alpha: float
  :param alpha: alpha
  
  :rtype: tuple
  :return: Returns mixed inputs, pairs of targets, and lambda
docstr_tok: ["This","method","performs","mixup",".","If","runs","=","1","it","just","does","1","mixup","with","whole","batch",",","any","n","of","runs","creates","many","mixup","matches",".",":","type","x",":","Numpy","array",":","param","x",":","Data","array",":","type","y",":","Numpy","array",":","param","y",":","(","optional",")","labels",":","type","alpha",":","float",":","param","alpha",":","alpha",":","rtype",":","tuple",":","return",":","Returns","mixed","inputs",",","pairs","of","targets",",","and","lambda"]
code: def mixup_data(self, x, y=None, alpha=0.2):
      """This method performs mixup. If runs = 1 it just does 1 mixup with whole batch, any n of runs
      creates many mixup matches.
  
      :type x: Numpy array
      :param x: Data array
      :type y: Numpy array
      :param y: (optional) labels
      :type alpha: float
      :param alpha: alpha
  
      :rtype: tuple
      :return: Returns mixed inputs, pairs of targets, and lambda
      """
      if self.runs is None:
          self.runs = 1
      output_x = []
      output_y = []
      batch_size = x.shape[0]
      for i in range(self.runs):
          lam_vector = np.random.beta(alpha, alpha, batch_size)
          index = np.random.permutation(batch_size)
          mixed_x = (x.T * lam_vector).T + (
              x[index, :].T * (1.0 - lam_vector)
          ).T
          output_x.append(mixed_x)
          if y is None:
              return np.concatenate(output_x, axis=0)
          mixed_y = (y.T * lam_vector).T + (
              y[index].T * (1.0 - lam_vector)
          ).T
          output_y.append(mixed_y)
      return np.concatenate(output_x, axis=0), np.concatenate(
          output_y, axis=0
      )
  
imports: import numpy
  import random
label_desc: Use image node_id 3 for calling the MIXUP obj's underlying member method code with example usage: obj.mixup_data(x, y, alpha) and returns: np,  np, np