-
Notifications
You must be signed in to change notification settings - Fork 22
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
ValueError: Querying emulator outside of original parameter range. #149
Comments
Sorry for the delayed response,I will take a look at this soon. Can you let me know which versions of Python and Starfish you are using? This error occurs when you try and retrieve a spectrum outside of your model grid, not sure why it could be happening in the tutorial. |
Thanks a lot for your email. Yes, I don't find the problem. I am trying to
run it for another sample.
Python 3.9.7
Starfish 0.4.2
…On Sun, 8 Jan 2023 at 23:36, Miles Lucas ***@***.***> wrote:
Sorry for the delayed response,I will take a look at this soon. Can you
let me know which versions of Python and Starfish you are using?
This error occurs when you try and retrieve a spectrum outside of your
model grid, not sure why it could be happening in the tutorial.
—
Reply to this email directly, view it on GitHub
<#149 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AP5BJSMLD2HDCCL3SQ5S7DLWRM6P5ANCNFSM6AAAAAATDRVAU4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Fatemeh Davoudi
*Postdoctoral researcher at University of Liège, Belgium*
|
I am running into the same error, though I am using my own data and running Python 3.9.12. |
This error should arise when you try to evaluate the spectral emulator with values outside of the original grid window, so for example the emulator was trained from [5000, 5700] and you attempt to recreate a 5704.1 Teff. Usually one prevents an MCMC from wandering past these boundaries by enforcing a prior that does not allow the walkers to reach this point---can you confirm that the prior and likelihood are structured in such a way that would prevent the spectral reconstruction from occurring if handed an out-of-bounds grid point? |
The ranges I currently have set are Teff=[3700, 5500], logg=[4.0, 5.0], and Z=[-0.5, 0.5], and the priors I have set are |
Hi, (not apart of the devs but ran into this error before too), ensure your global covariance kernel variables , log_amp and log_ls also match within the 'priors = {...}' and the 'model = SpectrumModel(...)'. In addition, that the two variables give you a reasonable standard deviation fit on the residuals graph before these steps. If not, it will also output the same valueerror. Don't know if this helps! |
Hi @astro-catherine, a few thoughts:
Do any of those solve the problem? |
Thank you very much for your answers, those are useful. Solved my problem, for solving it
2: I changed the value for the covariance kernel variables according to #148. Either one alone didn't solve my problem. I tried them several times. Now that the training for numerical optimization has been completed correctly, the next problem is that I don't have a correct residual graph even after using an optimized initial model. "In the single.ipynb as Starfish example, I see the residual graph is getting true after this step unlike mine." Do you have any suggestions to correct it? Any help would be appreciated. I write here the original ranges, SpectrumModel, and priors too, thanks a lot: ranges = [[2400, 3900], [4.5, 5.5], [-1, 1]] # T, logg, Z model = SpectrumModel( priors = { |
A log_amp value of -11 is okay for the example spectrum given in 'single.ipynb' where the flux values are around ~6x10^-1. Your flux is 1x10^-19, trying changing the log_amp to around -30 (equally with the prior)? My best guess is just playing with this number until you see scale in the residuals appearing. |
Yay, glad this issue is resolved. And yes, what @AustenWallis said. If you have absolute flux units the absolute value of your noise model terms will have to be adjusted to be at least in the same order of magnitude for initialization. I'm inclined to close this Issue since the proposed solutions have been shown to work, and there is no outstanding bug. @astro-catherine if you are still experiencing problems please reopen the Issue or make a new Issue with any revised friction points. Thank you all 🙏 |
Thanks for your attention in advance. As for the examples file, after running of setup. ipynb successfully, I want to run single.ipynb, but the following cell
%time model.train(priors),
it can not run correctly and I got this error (without any change in the previous cells):
ValueError: Querying emulator outside of original parameter range.
The text was updated successfully, but these errors were encountered: