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

getting nan in gaussian.py example #10

Open
timothydmorton opened this issue Jun 24, 2016 · 10 comments
Open

getting nan in gaussian.py example #10

timothydmorton opened this issue Jun 24, 2016 · 10 comments
Assignees
Labels

Comments

@timothydmorton
Copy link

timothydmorton commented Jun 24, 2016

Hey folks-- Just tried to run the gaussian python example, and for everything past sample 60, log(Z) = nan.

# Timothys-MacBook-Pro:gaussian tdm$ python gaussian.py 
# Seeding random number generators. First seed = 1234.
# Generating 5 particles from the prior...done.
# Creating level 1 with log likelihood = -21.2056127777.
# Creating level 2 with log likelihood = -15.3685054541.
# Creating level 3 with log likelihood = -11.7700107885.
# Creating level 4 with log likelihood = -9.32051503195.
# Creating level 5 with log likelihood = -7.78605572939.
# Creating level 6 with log likelihood = -6.75872064936.
Sample 10: log(Z) = nan [exact log(Z) = -11.5129283315]
# Creating level 7 with log likelihood = -6.0339250471.
# Creating level 8 with log likelihood = -5.53167376151.
# Creating level 9 with log likelihood = -5.21513935676.
# Creating level 10 with log likelihood = -5.00255785472.
# Creating level 11 with log likelihood = -4.86598501177.
Sample 20: log(Z) = -11.7090824614 [exact log(Z) = -11.5129283315]
# Creating level 12 with log likelihood = -4.77161110429.
# Creating level 13 with log likelihood = -4.70819909729.
# Creating level 14 with log likelihood = -4.67341103414.
# Creating level 15 with log likelihood = -4.6502281122.
Sample 30: log(Z) = nan [exact log(Z) = -11.5129283315]
# Creating level 16 with log likelihood = -4.63258890385.
# Creating level 17 with log likelihood = -4.62006698283.
# Creating level 18 with log likelihood = -4.61211722021.
Sample 40: log(Z) = -11.6631834445 [exact log(Z) = -11.5129283315]
# Creating level 19 with log likelihood = -4.60642900501.
# Done creating levels.
Sample 50: log(Z) = -11.5682956298 [exact log(Z) = -11.5129283315]
Sample 60: log(Z) = nan [exact log(Z) = -11.5129283315]
Sample 70: log(Z) = nan [exact log(Z) = -11.5129283315]
Sample 80: log(Z) = nan [exact log(Z) = -11.5129283315]
Sample 90: log(Z) = nan [exact log(Z) = -11.5129283315]
[etc...]
@dfm
Copy link
Collaborator

dfm commented Jun 24, 2016

I can't reproduce this. Are you using a recent github checkout? How did you install? What version of numpy do you have? Can you post your sample.txt, sample_info.txt, and levels.txt files somewhere?

@timothydmorton
Copy link
Author

timothydmorton commented Jun 24, 2016

Yeah, I just cloned the repo, using numpy v. 1.10.0.

installed with python setup.py install in the python directory.

files are here.

@timothydmorton
Copy link
Author

For what it's worth, I just conda update numpy'd and am still getting nans.

@dfm
Copy link
Collaborator

dfm commented Jun 24, 2016

I just tested with that old numpy version and your files and I still don't get nans so I'm really not sure what's going on....

@dfm
Copy link
Collaborator

dfm commented Jun 24, 2016

What about if you navigate to the directory where these files are saved and run

from dnest4.analysis import postprocess
postprocess()

Still nans?

@eggplantbren
Copy link
Owner

dnest4.classic.postprocess() and dnest4.analysis.postprocess() both work for me with those output files*. The former could be a workaround for now.

  • They yield very slightly different logZs, which I wasn't expecting. I thought we checked this!

@dfm
Copy link
Collaborator

dfm commented Jun 25, 2016

That's a work around only if the classic post process works! They both work
fine for me too so we don't know what his problem is yet.
On Sat, Jun 25, 2016 at 4:19 AM Brendon J. Brewer [email protected]
wrote:

dnest4.classic.postprocess() and dnest4.analysis.postprocess() both work
for me with those output files*. The former could be a workaround for now.

  • They yield very slightly different logZs, which I wasn't expecting.
    I thought we checked this!


You are receiving this because you were assigned.

Reply to this email directly, view it on GitHub
#10 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAVYSgIKx9ALhoMZomH_KD7d70pmos_-ks5qPJ47gaJpZM4I-Ky3
.

@timothydmorton
Copy link
Author

Just getting to look at this again now--- still nans for me doing what Dan
suggests above. I'll try it in a fresh environment to help try to isolate
what's going on.

On Sat, Jun 25, 2016 at 3:49 AM Dan Foreman-Mackey [email protected]
wrote:

That's a work around only if the classic post process works! They both work
fine for me too so we don't know what his problem is yet.
On Sat, Jun 25, 2016 at 4:19 AM Brendon J. Brewer <
[email protected]>
wrote:

dnest4.classic.postprocess() and dnest4.analysis.postprocess() both work
for me with those output files*. The former could be a workaround for
now.

  • They yield very slightly different logZs, which I wasn't expecting.
    I thought we checked this!


You are receiving this because you were assigned.

Reply to this email directly, view it on GitHub
<#10 (comment)
,
or mute the thread
<
https://github.com/notifications/unsubscribe/AAVYSgIKx9ALhoMZomH_KD7d70pmos_-ks5qPJ47gaJpZM4I-Ky3

.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#10 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABzr21egRae0qDs0XRMKQB7bPxDafPlsks5qPN1zgaJpZM4I-Ky3
.

@timothydmorton
Copy link
Author

I've repeated this in a fresh and minimal conda environment, which I've posted here.

@dfm
Copy link
Collaborator

dfm commented Jun 28, 2016

Interesting. It must be a Python 2 thing then. I'll try to debug and get back to you.

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

3 participants