smt icon indicating copy to clipboard operation
smt copied to clipboard

SGP Gradients unsupported

Open NAThompson opened this issue 1 year ago • 1 comments

Visualization of the function returned from SGP indicates that this model of the data is indeed differentiable. However, the .gradient method is not defined:

sgp = SGP()
sgp.set_training_values(xs, ys)
sgp.train()
sgp.gradient([1.2, 2.3, 4.6])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~venv/lib/python3.12/site-packages/smt/surrogate_models/surrogate_model.py", line 333, in predict_derivatives
    check_support(self, "derivatives")
  File "~venv/lib/python3.12/site-packages/smt/utils/checks.py", line 25, in check_support
    raise NotImplementedError("{} does not support {}".format(class_name, name))
NotImplementedError: SGP does not support derivatives

Are gradient fundamentally unavailable, or could this be implemented?

NAThompson avatar Jun 07 '24 17:06 NAThompson

To the best of my knowledge, sparse GP derivatives can be implemented. We just need a PR. 😉

relf avatar Jun 10 '24 07:06 relf