code: def load_or_generate_snelson(fname="code/experiments/data/"):
      """
      Snelson dataset from http://www.gatsby.ucl.ac.uk/~snelson/SPGP_dist.zip
  
      Args:
  
      Returns:
          X       - (num_points, 1) nparray
          Y       - (num_points, 1) nparray
          X_star  - (num_test_points, 1) nparray
      """
      X = np.genfromtxt(fname + "snelson_train_inputs")
      Y = np.genfromtxt(fname + "snelson_train_outputs")
      # X_star = np.fromfile(fname + 'snelson_test_inputs')
  
      idx = np.argsort(X, axis=0)
      X = np.reshape(X[idx], (-1, 1))
      Y = np.reshape(Y[idx], (-1, 1))
  
      try:
          if force_new:
              raise Exception
          X_train = np.load(fname + "snelson_X.npy")
          Y_train = np.load(fname + "snelson_Y.npy")
          X_test = np.load(fname + "snelson_Xtest.npy")
          Y_test = np.load(fname + "snelson_Ytest.npy")
      except:
          train_idx = np.linspace(
              0, X.shape[0], 11, endpoint=False
          ).astype(int)
          train_idx = train_idx[1:]
          X_train = X[train_idx, :]
          Y_train = Y[train_idx, :]
          X_test = X
          Y_test = Y
  
          meanx = np.mean(X_train)
          meany = np.mean(Y_train)
          stdx = np.std(X_train)
          stdy = np.std(Y_train)
  
          X_train = (X_train - meanx) / stdx
          Y_train = (Y_train - meany) / stdy
          X_test = (X_test - meanx) / stdx
          Y_test = (Y_test - meany) / stdy
  
          idx = np.argsort(X_test, axis=0)
          X_test = np.reshape(X_test[idx], (-1, 1))
          Y_test = np.reshape(Y_test[idx], (-1, 1))
  
      np.save(fname + "snelson_X.npy", X_train)
      np.save(fname + "snelson_Y.npy", Y_train)
      np.save(fname + "snelson_Xtest.npy", X_test)
      np.save(fname + "snelson_Ytest.npy", Y_test)
      # X_star = np.reshape(X_star, (-1, 1))
  
      return [X_train, Y_train, X_test, Y_test]
  
file_path: elu-gelu-kernels/code/experiments/data/other_datasets.py
imports: import numpy
  import itertools
label_desc: Use image node_id 5 for calling a global function with example usage: load_or_generate_snelson(fname) and returns: list