Skip to content
Snippets Groups Projects
Commit 79dc4c87 authored by Tizian Wenzel's avatar Tizian Wenzel
Browse files

Modified some more stuff.

parent 652733fd
Branches
No related tags found
No related merge requests found
......@@ -14,6 +14,9 @@ from scipy import io
import os
np.random.seed(1)
## Some settings
# name_dataset = 'example_5d_faster_conv'
name_dataset = 'example_6d_kink'
......
......@@ -9,6 +9,10 @@ from utils.hyperparameters import dic_hyperparams
from scipy import io
import os
import numpy as np
np.random.seed(1)
list_datasets = ['fried', 'sarcos', 'protein', 'ct', 'diamonds',
......
......@@ -9,6 +9,10 @@ from matplotlib import pyplot as plt
from scipy import io
import os
import scipy
import numpy as np
np.random.seed(1)
## Some settings
......
......@@ -14,6 +14,9 @@ from utils.hyperparameters import dic_hyperparams
from utils.main_function import run_everything
np.random.seed(1)
## Some settings
list_nctrs = [int(np.round(nr)) for nr in np.logspace(np.log(10) / np.log(10), np.log(1000) / np.log(10), 10)]
......
......@@ -13,6 +13,9 @@ import pickle
import scipy
np.random.seed(1)
## Some settings
list_nctrs = [int(np.round(nr)) for nr in np.logspace(np.log(10) / np.log(10), np.log(1000) / np.log(10), 10)]
......
......@@ -38,10 +38,12 @@ def run_everything(name_dataset, maxIter_vkoga, N_points, noise_level, reg_para_
# Preprocessing
if 'example' in name_dataset:
# No need to shuffle as dataset is randomly generated
idx = np.arange(X.shape[0])
else:
assert idx_rerun is not None, 'idx_rerun is not set!'
idx = np.load(path_for_indices + '_indices_{}/indices_'.format(idx_rerun) + name_dataset + '.npy')
# Random but fixed indices were removed, instead use randomly shuffled every time
idx = np.arange(X.shape[0])
np.random.shuffle(idx)
n_train = int(.8 * X.shape[0])
......@@ -50,7 +52,6 @@ def run_everything(name_dataset, maxIter_vkoga, N_points, noise_level, reg_para_
X_test = X[idx[n_train:]]
y_test = y[idx[n_train:]]
X_train_torch, y_train_torch = torch.from_numpy(X_train).type(torch.float), torch.from_numpy(y_train).type(torch.float)
# ToDo: noise level removed! (was set to 0 so far!)
## Select kernel
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment