code: def load_or_generate_1d_regression(
      train_size=10,
      test_size=100,
      fname="code/experiments/data/",
      force_new=True,
      noise_var=0.1,
  ):
      """
      Toy 1D regression dataset.
  
      Args:
          train_size (int): number of training examples
          test_size (int): number of testing examples
      Returns:
          X_train (nparray): (train_size, 1)
          Y_train (nparray): (train_size, 1)
          X_test (nparray): (test_size, 1)
          Y_test (nparray): (test_size, 1)
      """
      try:
          if force_new:
              raise Exception
          X_train = np.load(fname + "regression_train_x.npy")
          Y_train = np.load(fname + "regression_train_y.npy")
          X_test = np.load(fname + "regression_test_x.npy")
          Y_test = np.load(fname + "regression_test_y.npy")
      except:
          f = lambda x: np.sin(2 * np.pi * x / np.sqrt(3)) + np.sqrt(
              noise_var
          ) * np.random.normal(size=x.shape)
          X_train = np.reshape(
              np.linspace(-np.sqrt(3), np.sqrt(3), train_size),
              (train_size, 1),
          )
          Y_train = f(X_train)
          X_test = np.random.uniform(-np.sqrt(3), np.sqrt(3), test_size)
          X_test = np.reshape(np.sort(X_test, None), (test_size, 1))
          Y_test = f(X_test)
  
      np.save(fname + "regression_train_x.npy", X_train)
      np.save(fname + "regression_train_y.npy", Y_train)
      np.save(fname + "regression_test_x.npy", X_test)
      np.save(fname + "regression_test_y.npy", Y_test)
  
      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 6 for calling a global function with example usage: load_or_generate_1d_regression(train_size, test_size, fname, force_new, noise_var) and returns: list