Closed segasai closed 3 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
py/dynesty/sampler.py | 1 | 2 | 50.0% | ||
py/dynesty/sampling.py | 69 | 70 | 98.57% | ||
py/dynesty/dynesty.py | 12 | 16 | 75.0% | ||
<!-- | Total: | 82 | 88 | 93.18% | --> |
Totals | |
---|---|
Change from base Build 880284049: | -0.3% |
Covered Lines: | 3343 |
Relevant Lines: | 4665 |
This is ready for review/merge. (And with those set of changes I was finally able to get through my entire set of 60k objects without crashes)
The current slice samplng code still gave me the problems like this
It turns out that the reason is that during the slice sampling iterations due to floating point errors, it may happen that the original starting point is not more in the slice. The proposed patch fixes that and more:
refactor slice sampling by separating the single slice sampling step in a separate function that allows sharing the code between _slice and _rslice samplers. Also the slice sampling is now more numerically stable due to the fact that we are working in the 'coordinate system' of u0 + x* direction, i.e. we are always strictly guaranteed to have an initial point at 0 and are not affected by the precision loss