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
Describe the bug
While i was recreating the example for adaptive kriging "Expected Improvement - Branin Hoo" (https://uqpyproject.readthedocs.io/en/latest/auto_examples/sampling/adaptive_kriging/adaptive_kriging_branin_hoo.html#expected-improvement-branin-hoo) using the Expected Improvement for Global Fit (EIGF) criteria instead, the new samples did not correspond to the behaviour of the learning function. This happens because the array "qoi_array", that contains the qoi of the closest training point, is 1D with the shape (learning_nsamples,), so that the array "u" which computes the learning function at every point in the population, is broadcasted to the shape (learning_nsamples, learning_nsamples).
Steps To Reproduce
Go to "Adaptive Kriging Examples" and "Expected Improvement - Branin Hoo"
Replace the learning function with "ExpectedImprovementGlobalFit()"
Run the example and take a look at the location of new samples
Now add the line "qoi_array = qoi_array.reshape([population.shape[0], 1])" in the source code of the EIGF function
Refresh the python kernel, run the example again and take a look at the location of new samples
Compare the sampling behavior
Expected behavior
To get a reasonable new sample point, the array of the learning function "u" needs the shape (learning_nsamples, 1), which is archieved by reshaping the array "qoi_array" with the following line before "u" is computed:
qoi_array = qoi_array.reshape([population.shape[0], 1]) #shape(learning_nsamples, 1)
With that, you get new samples where the uncertainty of the Gaussian Process is highest in the given parameter space.
Screenshots
The first plot shows the sampling with the original code and the second plot with the added line.
Describe the bug
While i was recreating the example for adaptive kriging "Expected Improvement - Branin Hoo" (https://uqpyproject.readthedocs.io/en/latest/auto_examples/sampling/adaptive_kriging/adaptive_kriging_branin_hoo.html#expected-improvement-branin-hoo) using the Expected Improvement for Global Fit (EIGF) criteria instead, the new samples did not correspond to the behaviour of the learning function. This happens because the array "qoi_array", that contains the qoi of the closest training point, is 1D with the shape (learning_nsamples,), so that the array "u" which computes the learning function at every point in the population, is broadcasted to the shape (learning_nsamples, learning_nsamples).
Steps To Reproduce
Expected behavior
To get a reasonable new sample point, the array of the learning function "u" needs the shape (learning_nsamples, 1), which is archieved by reshaping the array "qoi_array" with the following line before "u" is computed:
qoi_array = qoi_array.reshape([population.shape[0], 1]) #shape(learning_nsamples, 1)
With that, you get new samples where the uncertainty of the Gaussian Process is highest in the given parameter space.
Screenshots


The first plot shows the sampling with the original code and the second plot with the added line.