dfm / george

Fast and flexible Gaussian Process regression in Python
http://george.readthedocs.io
MIT License
450 stars 128 forks source link

Unable to update values on a custom mean model. #142

Closed arkottke closed 3 years ago

arkottke commented 3 years ago

I implemented george.modeling.Model to provide a custom model. During optimization, it tries to call self.set_vector. I believe that this should be self.set_parameter_vector. The potential bug here:

for i, v in enumerate(vector):
    vector[i] = v + _EPS
    self.set_vector(vector)
    value = self.get_value(*args, **kwargs)
    vector[i] = v
    self.set_vector(vector)
    grad[i] = (value - value0) / _EPS
dfm commented 3 years ago

Yes - definitely a bug! This was fixed in https://github.com/dfm/george/pull/90 but I never merged that because I got too far behind on PRs :/ I'd be happy to accept an updated one directed at the main branch.

arkottke commented 3 years ago

Sure, I will send a PR to fix this issue.