-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experiments: As #2 describes, we now have a functioning script for GP…
… and SCGP comparision with reducing points.
- Loading branch information
1 parent
a42214b
commit cde8aaf
Showing
65 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import pathlib | ||
import time | ||
import torch | ||
import gpytorch | ||
from scgp.utils import save_plot_scgp, scgp_fit, save_plot_gp, gp_fit | ||
|
||
PATH = pathlib.Path(__file__).parent.parent.parent.absolute() | ||
DATA_PATH = PATH / "data" | ||
LOGGING = False | ||
|
||
if __name__ == "__main__": | ||
datasets = { | ||
"uniform_new_HC": DATA_PATH / "Gaussian_logCA0_uniform_J=20_HC.csv", | ||
"uniform_new_MC": DATA_PATH / "Gaussian_logCA0_uniform_J=20_MC.csv", | ||
"adaptive_new_HC": DATA_PATH / "Gaussian_logCA0_adaptive_J=20_HC.csv", | ||
"adaptive_new_MC": DATA_PATH / "Gaussian_logCA0_adaptive_J=20_MC.csv", | ||
} | ||
|
||
models = { | ||
# "SCGP": { | ||
# "kernel": gpytorch.kernels.RBFKernelGrad, | ||
# "plot": save_plot_scgp, | ||
# "fit": scgp_fit, | ||
# }, | ||
"GP": { | ||
"kernel": gpytorch.kernels.RBFKernel, | ||
"plot": save_plot_gp, | ||
"fit": gp_fit, | ||
}, | ||
} | ||
|
||
scenarios = { | ||
"nobs": list(range(6, 21, 2)), | ||
} | ||
|
||
for model_name, model in models.items(): | ||
for scenario in scenarios["nobs"]: | ||
for dataset_name, dataset_path in datasets.items(): | ||
start_time = time.time() | ||
try: | ||
kernel = model["kernel"]() | ||
train_x, train_y, data, data_likelihood = model["fit"]( | ||
dataset_path, 2000, kernel=kernel, nobs=scenario | ||
) | ||
name = f"{model_name}_{scenario}_nobs" | ||
model["plot"]( | ||
train_x, | ||
train_y, | ||
data, | ||
data_likelihood, | ||
name, | ||
dataset_name, | ||
) | ||
final_time = time.time() - start_time | ||
print( | ||
f"Finished {model_name} on {dataset_name}" | ||
f" with nobs={scenario}" | ||
f", it took {final_time:.2f}s" | ||
) | ||
del train_x, train_y, data, data_likelihood, kernel | ||
|
||
except Exception as e: | ||
print(f"Error on {model_name} on {dataset_name} | {e}") | ||
continue |