Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kriging based surrogates are not pickable #153

Closed
relf opened this issue Jun 13, 2019 · 2 comments · Fixed by #154
Closed

Kriging based surrogates are not pickable #153

relf opened this issue Jun 13, 2019 · 2 comments · Fixed by #154
Assignees

Comments

@relf
Copy link
Member

relf commented Jun 13, 2019

Current Kriging based surrogates are not pickable because of options related to regression or correlation functions which are actual functions which results in the following error message

cPickle.PicklingError: Can't pickle : attribute lookup __builtin__.function failed

Actually the declaration of those options (poly, corr) is a bit hacky as such option allows to specify a callable while acceptable values are documented to be an enumerate.
This implementation has the benefit to allow the user to specify is own functions for correlation and regression but it prevents from pickling.
I would like to propose a pull request to modify the code to have the current Krigings implementation pickable (hence make these options an enumerate). I am not sure at the moment on what is the best way to keep the "user-defined correlation or regression functions" capability. Is it used? Do we have to keep it? Plugin mechanism? Any thoughts?

@bouhlelma
Copy link
Member

user-defined correlation or regression functions is not supported by SMT. In the current version of SMT, if the user wants to add a defined function, he has to declare it manually. I agree to make these options an enumerate

@relf
Copy link
Member Author

relf commented Jun 13, 2019

My point is that currently the user could declare his own function and give it to the corr or poly options which are of FunctionType type (and provided the user knows what he is doing). By using an enumerate, we will loose this capability.
But if you are ok, it is fine with me. If really need be, we could add new functions in kriging_utils or think about a plugin mechanism to allow the user defined functions later on.

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 a pull request may close this issue.

2 participants