Mean function and kernel with common/shared hyperparameters #474
Answered
by
theo-brown
theo-brown
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
theo-brown
Sep 9, 2024
Replies: 1 comment 5 replies
-
My first thought is to subclass I'm not sure whether there's a neater way of doing it, but here goes: class MyPrior(gpx.gps.Prior):
def __init__(
self,
a: float,
b: float,
jitter: float = 1e-6,
):
self.a = parameters.Real(a)
self.b = parameters.Real(b)
self.jitter = jitter
@property
def kernel(self):
return MyKernel(self.b.value)
@property
def mean_function(self):
return MyMean(self.a.value, self.b.value) where |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looking at the source code, rather than the docs, the implemented kernels have an additional check in in their constructor:
which seems to get round this. If I implement this logic: