Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The input of GPCoregionalizedRegression #1024

Open
BinglinW opened this issue Aug 15, 2023 · 1 comment
Open

The input of GPCoregionalizedRegression #1024

BinglinW opened this issue Aug 15, 2023 · 1 comment
Labels
need more info If an issue or PR needs further information by the issuer

Comments

@BinglinW
Copy link

BinglinW commented Aug 15, 2023

Hi,

When I use the GPCoregionalizedRegression, the train data has some wrong.
I will input X_0 and Y_0 as two training sets, X_0 is an array format, it has 20 rows, 3 columns, so it has 3 dimensional input, 20 sample points, and Y_0 has 30 output, so it is a 20 by 30 array. I test my input format with a minimal example of two dots, and it keeps getting errors

K = GPy.kern.Matern32(input_dim=dim)
 icm = GPy.util.multioutput.ICM(input_dim=dim ,num_outputs=t_max,kernel=K)

 m = GPy.models.GPCoregionalizedRegression(X_list=[X_0[0, :].reshape(-1,1),X_0[1, :].reshape(-1,1)],
Y_list=[Y_0[0, :].reshape(-1,),Y_0[1, :].reshape(-1,)],
kernel=icm)

Then the error is

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
File [~/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/GPy/kern/src/kern.py:115](https://vscode-remote+ssh-002dremote-002b127-002e0-002e0-002e1.vscode-resource.vscode-cdn.net/home/dell/wbl/~/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/GPy/kern/src/kern.py:115), in Kern._slice_X(self, X)
    [114](file:///home/dell/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/GPy/kern/src/kern.py?line=113) try:
--> [115](file:///home/dell/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/GPy/kern/src/kern.py?line=114)     return X[:, self._all_dims_active].astype('float')
    [116](file:///home/dell/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/GPy/kern/src/kern.py?line=115) except:

IndexError: index 2 is out of bounds for axis 1 with size 2

During handling of the above exception, another exception occurred:

IndexError                                Traceback (most recent call last)
/home/dell/wbl/main_compare_multioutputGP_gpy.py in line 7
      [73](file:///home/dell/wbl/main_compare_multioutputGP_gpy.py?line=72) X_0_list = [list(row) for row in X_0]
      [74](file:///home/dell/wbl/main_compare_multioutputGP_gpy.py?line=73) Y_0_list = [list(row) for row in Y_0]
----> [75](file:///home/dell/wbl/main_compare_multioutputGP_gpy.py?line=74) m = GPy.models.GPCoregionalizedRegression(X_list=[X_0[0, :].reshape(-1,1),X_0[1, :].reshape(-1,1)],
      [76](file:///home/dell/wbl/main_compare_multioutputGP_gpy.py?line=75)                                           Y_list=[Y_0[0, :].reshape(-1,),Y_0[1, :].reshape(-1,)],
      [77](file:///home/dell/wbl/main_compare_multioutputGP_gpy.py?line=76)                                           kernel=icm)

File [~/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/paramz/parameterized.py:58](https://vscode-remote+ssh-002dremote-002b127-002e0-002e0-002e1.vscode-resource.vscode-cdn.net/home/dell/wbl/~/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/paramz/parameterized.py:58), in ParametersChangedMeta.__call__(self, *args, **kw)
     [56](file:///home/dell/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/paramz/parameterized.py?line=55) self._model_initialized_ = False
     [57](file:///home/dell/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/paramz/parameterized.py?line=56) if initialize:
---> [58](file:///home/dell/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/paramz/parameterized.py?line=57)     self.initialize_parameter()
     [59](file:///home/dell/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/paramz/parameterized.py?line=58) else:
     [60](file:///home/dell/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/paramz/parameterized.py?line=59)     import warnings
...
    [115](file:///home/dell/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/GPy/kern/src/kern.py?line=114)     return X[:, self._all_dims_active].astype('float')
    [116](file:///home/dell/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/GPy/kern/src/kern.py?line=115) except:
--> [117](file:///home/dell/anaconda3/envs/wbl_gpy_py39/lib/python3.9/site-packages/GPy/kern/src/kern.py?line=116)     return X[:, self._all_dims_active]

IndexError: index 2 is out of bounds for axis 1 with size 2

I read the instructions carefully, but still couldn't find the problem.The environment is Ubuntu, and I got a prompt when loading gpy-1.10.0

warning in coregionalize: failed to import cython module: falling back to numpy
warning in choleskies: failed to import cython module: falling back to numpy

I don't know if these warnings are related to the error

@MartinBubel
Copy link
Contributor

Hi @BinglinW
could you please add a script reproducing the error? Or give hints on the values of the variables dim, t_max, X_0, Y_0 so I can dig into this?

@MartinBubel MartinBubel added the need more info If an issue or PR needs further information by the issuer label Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info If an issue or PR needs further information by the issuer
Projects
None yet
Development

No branches or pull requests

2 participants