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

Error from SMT --> ValueError: setting an array element with a sequence. #541

Open
Val4on opened this issue Mar 20, 2024 · 4 comments
Open
Labels

Comments

@Val4on
Copy link

Val4on commented Mar 20, 2024

After upgrading to version 2.4.0, I'm seeing the following errors:

TypeError: only length-1 arrays can be converted to Python scalars
krg_based.py", line 1127, in _reduced_likelihood_gradient
    grad_red[i_der] = (
ValueError: setting an array element with a sequence.

Is this a real issue or am I incorrectly using KPLS ?

@relf
Copy link
Member

relf commented Mar 21, 2024

Hi. Thank you for reporting. I think we've got an issue here. How do you call KPLS(), what options are you using? What is the dimension of your training inputs and the value of n_comp?

In 2.4, we've changed the default internal optimizer from COBYLA to TNC. The latter uses gradients, I guess that if you switch back to COBYLA by using KPLS(hyper_opt="Cobyla", ...) you will retrieve a working solution.

@relf relf added the bug label Mar 21, 2024
@Val4on
Copy link
Author

Val4on commented Mar 21, 2024 via email

@relf
Copy link
Member

relf commented Mar 21, 2024

  1. the point of using KPLS or KPLSK is to choose n_comp < num_params to get actual dimension reduction otherwise you'd better use KRG. What is the value of num_params? Whats is the shape of your training data (n_samples, n_dim) ? What is the shape/value of t0s?

  2. what version of SMT worked for you before?

  3. did you try to increase the nugget like it was suggested (option nugget=1e-8) when you test with Cobyla?

  4. If you go back to TNC you get an error, correct? At the moment I can not reproduce the error you've got. So without an actual example to reproduce the error, it is difficult to help you more on this.

@Val4on
Copy link
Author

Val4on commented Mar 21, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants