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
Added switch_dim parameter to ChangePoints kernel #1671
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1671 +/- ##
========================================
Coverage 97.00% 97.00%
========================================
Files 91 91
Lines 4168 4170 +2
========================================
+ Hits 4043 4045 +2
Misses 125 125
Continue to review full report at Codecov.
|
Hi @clwgg, thanks for thinking this through & contributing the PR:) |
While looking into covering this use-case with tests, I discovered that there are ChangePoint-related tests implemented both in tests/gpflow/kernels/test_kernels.py as well as a single one in tests/gpflow/kernels/test_changepoints.py. Is there any preference on where to implement the new tests? Also, should the ChangePoint tests be unified in a single file (either test_kernels or test_changepoints)? If so, I'd be happy to contribute that either here or in a separate PR. |
@clwgg apologies for dropping the ball on this. I hope you'd still be interested to finish off this PR!? |
This parameter allows to define the ChangePoint on one particular dimension of the input space. All other dimensions are still available to the kernels being switched, and can be selected via active_dims.
- move `ref_changepoints()` to reference.py - move changepoint tests to test_changepoints.py
Yes, absolutely! Sorry, it took me a moment to get back to it. I've added a few commits on the changepoint tests. These first reorganize all changepoint-related tests into the same file, and then add a few new ones. I think the new tests cover the behavior newly introduced here, and seem to be in line with the types of things the previous changepoint tests test. Please let me know what you think, and if you can think of something else changepoint-related that should be tested. Also, I've been wondering about the default value for the |
[Just tagging this SO question here to remind me to update my response upon merge: https://stackoverflow.com/questions/68209521] |
Hi @st--, I just thought I'd bump this to see if there's still interest in merging this? I'm happy to fix anything that needs fixing! |
PR type: bugfix / enhancement
Related issue(s)/PRs: Resolves #1195, also see https://stackoverflow.com/questions/59613675
Summary
Proposed changes
I propose to add a
switch_dim
parameter to the ChangePoints kernel to make it usable on multidimensional inputs. This parameter allows to define ChangePoints on one particular dimension of the input space, while leaving all dimensions accessible to the kernels being switched. This makes it possible to switch kernels on any (combination of) input dimensions based on one switching dimension.As an example, this setup allows structures such as:
This example has 2D input, and the kernel being switched is a product of kernels on the 1st and 2nd dimension. The
switch_dim
parameter allows to define a ChangePoint for this entire kernel product based on the 2nd dimension of the input.What alternatives have you considered?
I also have a working version of making the
active_dims
parameter accessible to the ChangePoints kernel as proposed on the SO link above. The issue with this was, that it only allows to switch kernels on the dimension on which the ChangePoint is defined, e.g.:Fully backwards compatible: I think so, but I will be adding tests to make sure
State of this PR
The PR is still a bit rough, but I'll be adding tests in the coming days if there's general interest in merging this ChangePoint setup. Alternatively, I'm also happy to contribute the
active_dims
version of handling multiple input dimensions I mention above.PR checklist
make format
)make check-all
)