DNest4 icon indicating copy to clipboard operation
DNest4 copied to clipboard

Python postprocessing functions yielding different results

Open tripathi opened this issue 8 years ago • 7 comments

Hi!

When running the Gaussian python example from commit 190180.. on a Mac (OSX10.10) with Python 2.7, it runs into NaNs for log_x_diff, and thus log_z when calculated by analysis.py's postprocess->compute_stats function. See analysispy.txt

However, if I manually postprocess the output using the postprocess function in deprecated.py, I get a reasonable value for log_z. See deprecatedpy.txt

Should I continue to use the deprecated function?

Note I've used MACOSX_DEPLOYMENT_TARGET=10.10 python setup.py install for builds (although I get the same result with TARGET=10.9).

tripathi avatar Mar 07 '16 21:03 tripathi

I can't reproduce this even with the same commit. What version of numpy? It's doing something weird with the way it handles underflow...

dfm avatar Mar 08 '16 00:03 dfm

Thanks for the quick response! I have numpy 1.9.2 (installed using canopy).

tripathi avatar Mar 08 '16 01:03 tripathi

Can you also attach the text files that the Gaussian example saves?

dfm avatar Mar 08 '16 01:03 dfm

posterior_sample.txt weights.txt levels.txt sample_info.txt sample.txt sampler_state.txt sample_log_X.txt (You can see all the infs) stats.txt

Note these are from a different run as that mentioned above, so I'm also attaching the new log file newlog.txt

Thanks!

tripathi avatar Mar 08 '16 01:03 tripathi

(I just came across the same issue btw - I'll try to post a more informative comment later)

omaclaren avatar Aug 24 '16 06:08 omaclaren

The workaround is to always use

import dnest4.classic
dnest4.classic.postprocess()

eggplantbren avatar Aug 24 '16 22:08 eggplantbren

Awesome, thanks, this worked for me.

And, I just realised that this is also discussed under https://github.com/eggplantbren/DNest4/issues/10

(sorry!). So to confirm - classic works for me but the default doesn't (i.e. it gives nans). I'm running Python 2.7.11.

omaclaren avatar Aug 25 '16 00:08 omaclaren