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

general matern kernels #134

Open
dhruvbalwada opened this issue Aug 16, 2020 · 3 comments
Open

general matern kernels #134

dhruvbalwada opened this issue Aug 16, 2020 · 3 comments

Comments

@dhruvbalwada
Copy link

dhruvbalwada commented Aug 16, 2020

Hello,
I am using the george package to model ocean flows and do spectral estimation from limited data. One way to do this by trying to fit a general matern kernel (or sum of 2-3 general matern kernels). I see that there is a MaternGeneral.yml.example in the kernels folder. I was wondering if this has actually been implemented and tried? or if there was some reason that it was not included in the documentation?

Also, I am working with 2D or 3D data, should I transition over to using GPyTorch, as recommended in #128 ? Specially considering, that I am just starting to get involved in GP modelling.

@dfm
Copy link
Owner

dfm commented Aug 17, 2020

The general Matern is not part of george since it requires boost. If you have boost installed, you should be able to get that implementation by cloning george, renaming the MaternGeneral.yml.example file by removing the .example, and re-installing. I should note that fitting for nu is not supported by this kernel, but you could at least try several values.

Switching to GPyTorch is probably better long term because it gets more support, but it looks like they don't have a general Matern implemented either (only 1/2, 3/2 and 5/2, same as george!).

@j-faria
Copy link

j-faria commented Oct 23, 2020

Hi Dan,
I'm having some trouble with this (and with implementing new kernels in general).
After renaming the MaternGeneral.yml.example file and recompiling (with python setup.py develop), several of the tests don't pass:

...george-0.3.1-py3.7-linux-x86_64.egg/george/kernels.py:66: AttributeError
========================================================= short test summary info ==========================================================
FAILED tests/test_gp.py::test_gradient[BasicSolver-None] - AttributeError: kernel
FAILED tests/test_gp.py::test_gradient[BasicSolver-0.1] - AttributeError: kernel
FAILED tests/test_gp.py::test_gradient[HODLRSolver-None] - AttributeError: kernel
FAILED tests/test_gp.py::test_gradient[HODLRSolver-0.1] - AttributeError: kernel
FAILED tests/test_gp.py::test_apply_inverse[BasicSolver] - AttributeError: kernel
FAILED tests/test_gp.py::test_apply_inverse[HODLRSolver] - AttributeError: kernel
FAILED tests/test_gp.py::test_predict_single[BasicSolver] - AttributeError: kernel
FAILED tests/test_gp.py::test_predict_single[HODLRSolver] - AttributeError: kernel
FAILED tests/test_kernels.py::test_dtype - AttributeError: kernel
FAILED tests/test_kernels.py::test_kernel[kernel0] - AttributeError: 'BaseConstantKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_kernel[kernel1] - AttributeError: 'BaseConstantKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_kernel[kernel2] - AttributeError: 'BaseConstantKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_kernel[kernel10] - AttributeError: 'BaseExpSine2Kernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_kernel[kernel11] - AttributeError: 'BaseExpSine2Kernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_kernel[kernel12] - AttributeError: 'BaseExpSine2Kernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_kernel[kernel13] - AttributeError: 'BaseExpSine2Kernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_kernel[kernel14] - AttributeError: 'BaseExpSine2Kernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_kernel[kernel15] - AttributeError: 'BaseExpSine2Kernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_kernel[kernel16] - ValueError: unrecognized kernel
FAILED tests/test_kernels.py::test_kernel[kernel17] - ValueError: unrecognized kernel
FAILED tests/test_kernels.py::test_kernel[kernel18] - ValueError: unrecognized kernel
FAILED tests/test_kernels.py::test_kernel[kernel19] - ValueError: unrecognized kernel
FAILED tests/test_kernels.py::test_kernel[kernel26] - AttributeError: 'BasePolynomialKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_kernel[kernel27] - AttributeError: 'BasePolynomialKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_kernel[kernel28] - AttributeError: 'BasePolynomialKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_kernel[kernel29] - AttributeError: 'BasePolynomialKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_kernel[kernel30] - AttributeError: 'BasePolynomialKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_kernel[kernel31] - AttributeError: kernel
FAILED tests/test_kernels.py::test_kernel[kernel32] - AttributeError: kernel
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel0] - AttributeError: 'BaseConstantKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel1] - AttributeError: 'BaseConstantKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel2] - AttributeError: 'BaseConstantKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel10] - AttributeError: 'BaseExpSine2Kernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel11] - AttributeError: 'BaseExpSine2Kernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel12] - AttributeError: 'BaseExpSine2Kernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel13] - AttributeError: 'BaseExpSine2Kernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel14] - AttributeError: 'BaseExpSine2Kernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel15] - AttributeError: 'BaseExpSine2Kernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel16] - ValueError: unrecognized kernel
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel17] - ValueError: unrecognized kernel
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel18] - ValueError: unrecognized kernel
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel19] - ValueError: unrecognized kernel
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel26] - AttributeError: 'BasePolynomialKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel27] - AttributeError: 'BasePolynomialKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel28] - AttributeError: 'BasePolynomialKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel29] - AttributeError: 'BasePolynomialKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel30] - AttributeError: 'BasePolynomialKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel31] - AttributeError: kernel
FAILED tests/test_kernels.py::test_x_gradient_kernel[kernel32] - AttributeError: kernel
FAILED tests/test_kernels.py::test_stationary[ExpKernel-kwargs0] - AttributeError: 'BaseExpKernel' object has no attribute 'kernel'
FAILED tests/test_kernels.py::test_stationary[RationalQuadraticKernel-kwargs4] - IndexError: boolean index did not match indexed array al...
FAILED tests/test_kernels.py::test_stationary[RationalQuadraticKernel-kwargs5] - IndexError: boolean index did not match indexed array al...
FAILED tests/test_kernels.py::test_stationary[RationalQuadraticKernel-kwargs6] - IndexError: boolean index did not match indexed array al...
FAILED tests/test_metrics.py::test_general_metric - AttributeError: kernel
FAILED tests/test_metrics.py::test_axis_algined_metric - AttributeError: kernel
FAILED tests/test_modeling.py::test_gp_mean - AttributeError: kernel
FAILED tests/test_modeling.py::test_gp_callable_mean - AttributeError: kernel
FAILED tests/test_modeling.py::test_gp_white_noise - AttributeError: kernel
FAILED tests/test_modeling.py::test_gp_callable_white_noise - AttributeError: kernel
FAILED tests/test_pickle.py::test_pickle[BasicSolver-True] - AttributeError: kernel
FAILED tests/test_pickle.py::test_pickle[HODLRSolver-False] - AttributeError: 'BaseConstantKernel' object has no attribute 'metric'
FAILED tests/test_solvers.py::test_basic_solver - AttributeError: kernel
FAILED tests/test_solvers.py::test_hodlr_solver - AttributeError: 'BaseConstantKernel' object has no attribute 'metric'
FAILED tests/test_solvers.py::test_strange_hodlr_bug - AttributeError: 'BaseConstantKernel' object has no attribute 'metric'
FAILED tests/test_tutorial.py::test_tutorial - AttributeError: kernel
================================================= 65 failed, 37 passed, 1 xfailed in 3.56s =================================================

I've also tried just copying the Constant.yml to a new file with a different name and the same thing happens.

@j-faria
Copy link

j-faria commented Oct 23, 2020

Nevermind, this probably had something to do with me doing setup.py develop instead of install and some old files lurking around. After removing the build directory, the problem is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants