dfm / george

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

Support for parameters with `CallableModel` #157

Open mcfarljm opened 2 years ago

mcfarljm commented 2 years ago

Is the interface for CallableModel supposed to support parameter values? It doesn't appear that this is currently possible (it would need to be sub-classed for the user to define parameter_names (which is used to determine full_size), but then it doesn't propagate any kwargs back to Model.__init__ for specifying parameter values).

AFAICT, it's not possible to use parameters with CallableModel, but that contradicts some parts of the interface, e.g., compute_gradient, which implies parameters (currently CallableModel.compute_gradient always operates on a null (length-0) parameter vector; this even occurs in some of the test cases, e.g., test_callable_mean, which has a check_gradient call that operates on a null parameter vector).

Since implementing a callable model with parameters by subclassing Model is straightforward, it's unclear what the use case for the CallableModel class is, and it might be better to remove it to avoid confusion.