OptimizationGradientError: x elements of the 80 element gradient array gradf are NaN.
#3133
Replies: 4 comments 4 replies
-
|
Hi @Friedemannn. Wrapping the loop in |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Friedemannn , I took a quick look at the parameter file and saw that all the values for recommended points were tiny, in the 0.01 range. I see that the bounds of your search space are specified as [0, 1]^D, but how do the X's look going into your GP? Is it intentional to have the initial samples be in this small range, but still have the bounds be [0, 1]? Since the values cover such a small range of the entire search space, the GP will not be able to fit the rest of the search space at all. You should do some space-filling with sobol for the second batch too. Then, you should hopefully see the BO working. |
Beta Was this translation helpful? Give feedback.
-
|
So @Friedemannn , Check out the TODOs regarding the bounds and I think you should be fine! If I'm wrong about something here, let me know! |
Beta Was this translation helpful? Give feedback.
-
|
So i think I solved the OptimizationGradientError .... I'm not a 100% sure because I wasnt able to rerun the parameter files yet that this issue was originally about. But after trying a bunch of random stuff chatgpt suggested, I had success by using a minimum noise contraint for the likelihood and running the fit with cholesky jitter. It's nice that it seems to work now, but tbh I have no clue what's happening under the hood. Can anyone give me some recommendations for reading material on this? |
Beta Was this translation helpful? Give feedback.



Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there,
I'm working on a BO Loop optimizing 2 physical parameters of a PIC simulation.
Up until now it went well. As input, i use a relatively well manually optimized PIC parameter file, of which two parameters then are varied (in bounds) by the BO Loop. They are also 10 initial simulations where the two parameters are varied randomly before the 40 iterations BO loop with q=4 starts (so 11 initial and 160 BO loop simulations).
The problems arise when the initial parameter file is chosen not so carefully. Then i more often then not run into the following error (sometimes after a few, sometimes after a lot of iterations):
My code looks like this:
After that PIC simulations are run based on the candidates, with the results the objective y_scaled is calculated.
If no electron beam was created in the simulation (or smth else goes wrong) the y_scaled value ist set to 0, so there can be a lot of 0s. But this error also seems to happen if there arent even that many 0s.
What i tried to do:
Is there something I can do botorch-wise to make the optimize_acqf() more robust against this?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions