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

RNG is not seeded #32

Open
mfisherlevine opened this issue Jul 31, 2019 · 1 comment
Open

RNG is not seeded #32

mfisherlevine opened this issue Jul 31, 2019 · 1 comment

Comments

@mfisherlevine
Copy link
Collaborator

np.random.seed() is never called, nor is an RNG instantiated and passed around, leading to non-deterministic results for the same input.

e.g. from d568533 run python runExtractor.py --verbose a few times and see both very different run times and different RuntimeWarnings (especially in the Start ChromaticPSF1D polynomial fit... and Calibrating order 1 spectrum... stages), as well as different final results sometimes.

@mfisherlevine
Copy link
Collaborator Author

Places with random used:

spectractor/simulation/image_simulation.py:261: noisy += np.random.normal(scale=self.read_out_noise)
spectractor/extractor/psf.py:1241: bgd_std = float(np.std(np.random.poisson(bgd)))
spectractor/extractor/psf.py:1448: bgd_std = float(np.std(np.random.poisson(bgd)))
spectractor/fit/fitter.py:68: [np.random.uniform(self.p[i] - 0.02 * self.p[i], self.p[i] + 0.02 * self.p[i], self.nwalkers)
spectractor/fit/fitter.py:70: self.start[self.start == 0] = 1e-5 * np.random.uniform(0, 1)

jeremyneveu pushed a commit that referenced this issue Apr 21, 2023
DM-38813: Only skip libradtran test if it's unavailable
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

No branches or pull requests

1 participant