jonasrothfuss / meta_learning_pacoh

Meta-learning Gaussian process (GP) priors via PAC-Bayes bounds
MIT License
25 stars 13 forks source link

Problem with GPR_meta_mlap.py #7

Open arezua1r2den opened 3 years ago

arezua1r2den commented 3 years ago

Hi,

I am running your code to compare Test RMSE on meta-training and meta-testing tasks as a function of the number of meta-training tasks for PACOH and MLAP. As you wrote in your code, I run: meta_train_data, meta_testdata, = provide_data(dataset='sin_20') NN_LAYERS = (32, 32, 32, 32)

gp_model_mlap = GPRegressionMetaLearnedPAC(meta_train_data, num_iter_fit=20000, task_kl_weight=1.0, meta_kl_weight=1e-5, lr=1e-3, lr_decay=0.97, posterior_lr_multiplier=5.0, svi_batch_size=5, task_batch_size=5, covar_module='NN', mean_module='NN', mean_nn_layers=NN_LAYERS, kernel_nn_layers=NN_LAYERS, cov_type='diag', normalize_data=True)

gp_model_mlap.meta_fit(valid_tuples=meta_test_data[:10], log_period=500, eval_period=10000, n_iter=10000)

The last line gives me the following error: PACOH\meta_learn\models.py in set_parameters_as_vector(self, value) 288 # self.set_parameter(name, value[:, idx:idx_next]) 289 else: --> 290 raise AssertionError

Could you please help me to fix this problem? In fact, for the given parameters, we have value.ndim=3. However, it should be either one or two.

Best regards

AR

Macheche commented 10 months ago

It might be an issue with the version of gpytorch. I recommend trying gpytorch=1.0.* to see if that resolves the problem. gpytorch is too stupid.