You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GPX surrogate doesn't seem to support outputs with ny>1, which works for the other surrogates. It runs, but seems to return the response for the first element only. I guess it could be fixed in here in SMT, but possibly also in the upstream egobox tool. Here's a small test that shows the difference between KRG and GPX:
import unittest
import numpy as np
from smt.surrogate_models import GPX, KRG
from smt.examples.rans_crm_wing.rans_crm_wing import get_rans_crm_wing
class TestNY(unittest.TestCase):
def test_ny_gpx(self):
xt, yt, _ = get_rans_crm_wing()
interp = GPX()
interp.set_training_values(xt, yt)
interp.train()
v0 = np.zeros((4, 2))
for ix, i in enumerate([10, 11, 12, 13]):
v0[ix, :] = interp.predict_values(np.atleast_2d(xt[i, :]))
v1 = interp.predict_values(np.atleast_2d(xt[10:14, :]))
self.assertEqual(v1.shape[1], yt.shape[1])
def test_ny_krg(self):
xt, yt, _ = get_rans_crm_wing()
interp = KRG()
interp.set_training_values(xt, yt)
interp.train()
v0 = np.zeros((4, 2))
for ix, i in enumerate([10, 11, 12, 13]):
v0[ix, :] = interp.predict_values(np.atleast_2d(xt[i, :]))
v1 = interp.predict_values(np.atleast_2d(xt[10:14, :]))
self.assertEqual(v1.shape[1], yt.shape[1])
The text was updated successfully, but these errors were encountered:
Actually, KRG is not meant to handle multiple outputs. It has been recently added (too discreetly!) at the end of the Kriging section but we should definitely raise an error if yt is not one-dimensional. When you use several training outputs you do not get the right predictions (the ones you get if you keep only one training output).
For GPX (or should I say egobox::Gpx), it happens that with the default setting only the first predicted output is kept, but still if you pass several training output data, the prediction you get is not the right one.
I keep this issue open as a reminder till we fix KRG (and kriging-based surrogates) and GPX (ie. raising a ValueError("Multiple outputs not handled") when yt is not one-dimensional).
The GPX surrogate doesn't seem to support outputs with
ny
>1, which works for the other surrogates. It runs, but seems to return the response for the first element only. I guess it could be fixed in here in SMT, but possibly also in the upstream egobox tool. Here's a small test that shows the difference between KRG and GPX:The text was updated successfully, but these errors were encountered: