Skip to content

Commit

Permalink
Experiments: As #2 describes, we now have a functioning script for GP…
Browse files Browse the repository at this point in the history
… and SCGP comparision with reducing points.
  • Loading branch information
adamesalles committed Aug 18, 2024
1 parent a42214b commit cde8aaf
Show file tree
Hide file tree
Showing 65 changed files with 64 additions and 0 deletions.
Binary file added experiments/adaptive_new_HC/GP_10_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/GP_12_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/GP_14_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/GP_16_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/GP_18_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/GP_20_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/GP_6_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/GP_8_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/SCGP_10_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/SCGP_12_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/SCGP_14_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/SCGP_16_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/SCGP_18_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/SCGP_20_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/SCGP_6_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_HC/SCGP_8_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_MC/GP_10_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_MC/GP_12_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_MC/GP_14_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_MC/GP_16_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_MC/GP_18_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_MC/GP_20_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_MC/GP_6_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_MC/GP_8_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_MC/SCGP_10_nobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added experiments/adaptive_new_MC/SCGP_12_nobs.png
Binary file added experiments/adaptive_new_MC/SCGP_14_nobs.png
Binary file added experiments/adaptive_new_MC/SCGP_16_nobs.png
Binary file added experiments/adaptive_new_MC/SCGP_18_nobs.png
Binary file added experiments/adaptive_new_MC/SCGP_20_nobs.png
Binary file added experiments/adaptive_new_MC/SCGP_6_nobs.png
Binary file added experiments/adaptive_new_MC/SCGP_8_nobs.png
Binary file added experiments/uniform_new_HC/GP_10_nobs.png
Binary file added experiments/uniform_new_HC/GP_12_nobs.png
Binary file added experiments/uniform_new_HC/GP_14_nobs.png
Binary file added experiments/uniform_new_HC/GP_16_nobs.png
Binary file added experiments/uniform_new_HC/GP_18_nobs.png
Binary file added experiments/uniform_new_HC/GP_20_nobs.png
Binary file added experiments/uniform_new_HC/GP_6_nobs.png
Binary file added experiments/uniform_new_HC/GP_8_nobs.png
Binary file added experiments/uniform_new_HC/SCGP_10_nobs.png
Binary file added experiments/uniform_new_HC/SCGP_12_nobs.png
Binary file added experiments/uniform_new_HC/SCGP_14_nobs.png
Binary file added experiments/uniform_new_HC/SCGP_16_nobs.png
Binary file added experiments/uniform_new_HC/SCGP_18_nobs.png
Binary file added experiments/uniform_new_HC/SCGP_20_nobs.png
Binary file added experiments/uniform_new_HC/SCGP_6_nobs.png
Binary file added experiments/uniform_new_HC/SCGP_8_nobs.png
Binary file added experiments/uniform_new_MC/GP_10_nobs.png
Binary file added experiments/uniform_new_MC/GP_12_nobs.png
Binary file added experiments/uniform_new_MC/GP_14_nobs.png
Binary file added experiments/uniform_new_MC/GP_16_nobs.png
Binary file added experiments/uniform_new_MC/GP_18_nobs.png
Binary file added experiments/uniform_new_MC/GP_20_nobs.png
Binary file added experiments/uniform_new_MC/GP_6_nobs.png
Binary file added experiments/uniform_new_MC/GP_8_nobs.png
Binary file added experiments/uniform_new_MC/SCGP_10_nobs.png
Binary file added experiments/uniform_new_MC/SCGP_12_nobs.png
Binary file added experiments/uniform_new_MC/SCGP_14_nobs.png
Binary file added experiments/uniform_new_MC/SCGP_16_nobs.png
Binary file added experiments/uniform_new_MC/SCGP_18_nobs.png
Binary file added experiments/uniform_new_MC/SCGP_20_nobs.png
Binary file added experiments/uniform_new_MC/SCGP_6_nobs.png
Binary file added experiments/uniform_new_MC/SCGP_8_nobs.png
64 changes: 64 additions & 0 deletions src/experiments/reducing-points-experiment.py
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

0 comments on commit cde8aaf

Please sign in to comment.