Skip to content

Conversation

@mcastanoUQ
Copy link
Contributor

Updates to the classes MFCK, SMFCK, SMFK
Small correction of a typo in MFK.
MFCK, SMFCK updates to handle het. noise.

…r MFK, adition of Prediction of heteroscedastic noise for SMFCK
@relf
Copy link
Member

relf commented Oct 24, 2025

Hi Mauricio. It seems like SMFCK tests (test_smfck.py) runs for ever! Then github actions are just cancelled.

Did you run your tests locally?

pytest smt\applications\tests\tests\test_smfck.py

@mcastanoUQ
Copy link
Contributor Author

I see the issue; it's strange, I compiled the script outside the test class, and it runs without problems. I'll try to change the test script to see if that solves the problem for the moment.

image

Copy link
Member

@relf relf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mcastanoUQ, smt does not have nlopt as a dependency, could you use cobyla from scipy.

@mcastanoUQ
Copy link
Contributor Author

mcastanoUQ commented Nov 28, 2025

@relf I changed it locally, but now I have found a problem in the class lhs.py line 367

File "D:\mcastano\Documents\Repositories\smt\smt\sampling_methods\lhs.py", line 367, in _ese
else lhs(dim, nt, criterion=None, seed=self.random_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: lhs() got an unexpected keyword argument 'seed'

@mcastanoUQ
Copy link
Contributor Author

mcastanoUQ commented Nov 28, 2025

If I change the line 367 from this:

else lhs(dim, nt, criterion=None, seed=self.random_state)

to this:

else lhs(dim, nt, criterion=None) #(I think it's not a solution, just a comment)

I can run everything without any problem. But, I think the issue is related to the change of "seed" instead of "random_state"

Should I change my code form "random_state" to "seed" everywhere, or does it work the same?

@relf
Copy link
Member

relf commented Nov 28, 2025

Please update the PR without using nlopt and we will see.

Regarding the error related to LHS, you may need to update the pyDOE3 package locally with pip install -U pyDOE3.
random_state option is deprecated (as np.RandomState is deprecated), it should still work though but please use seed now (it uses np.Generator behind the scene).

@mcastanoUQ
Copy link
Contributor Author

Bonjour @relf,

Une erreur ici: FAILED smt/tests/test_all.py::Test::test_exp_MGP - AssertionError: np.float64(1.781220778809592) not less than or equal to 0.06

Ce n’est pas parmi les classes que je suis en train de modifier ; je ne sais pas si c’est dû à un rebase manquant.



class SMFCK(KrgBased):
"This class will inherit the functions from the class MFCK"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure to understand this docstring. You intend to make SMFCK inherits from MFCK in a further PR? Change it TODO: This class should inherit from the class MFCK

t_error = num / den

self.assert_error(t_error, 0.0, 2e-1, 2e-1)
self.assert_error(t_error, 0.0, 1.0, 1.0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You relax the test tolerance to make it pass with scipy cobyla ? Add a comment here to explain that one has to install nlopt to use Cobyla-nlopt to get better performance. Maybe add keep the old line self.assert_error(t_error, 0.0, 2e-1, 2e-1) to tell it works with Cobyla from no=lopt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants