Coder Social home page Coder Social logo

Bounding fixes about dynesty HOT 5 CLOSED

segasai avatar segasai commented on June 11, 2024
Bounding fixes

from dynesty.

Comments (5)

segasai avatar segasai commented on June 11, 2024 1

Thanks for your comments @joshspeagle . I'm not sure that quite answered my question )) But I have now updated the #428 patch with a refactor (still somewhat preliminary) that gets rid of of the _beyound_unit.
Now there is a variable inside the class that is describing the current state of the sampler (unit cube sampling or not ).
And then there is update_bound_if_needed() function that performs the bound update if it is required.
The key difference (and that's where the previous code was incorrect I believe is that the ncall inside the _new_point() was local, preventing updates if nqueue was small enough I believe.
But anyway I think the current logic is much clearer. And I finally understand when/what could happen.
Let's see if that solves the #431 as well

from dynesty.

joshspeagle avatar joshspeagle commented on June 11, 2024

This definitely looks like a problem! Glad the fix is simple at least.

from dynesty.

segasai avatar segasai commented on June 11, 2024

I think there is more to it in #425 though with bound updates that is not quite right, I'm currently working on a possible patch/refactoring to get rid of the _beyond_unit_bound which was always a bit obscure.
with the aim of clearly separating the state of the sampler, i.e. are we using the bound or not , (and that should be just a scalar variable) from decision of possible updating the bound, which should be just in one single location.

The reason why I started doing that, is because I still do not understand why default ellipsoid centers/covariances are used at all for sampling. I thought they would always be updated before the run based on current points.

from dynesty.

segasai avatar segasai commented on June 11, 2024

While we on this @joshspeagle

I'm looking at this line:

ucheck = ncall >= self.update_interval * (1 + nupdate)

This lines implies that the boundary update will be done based on local ncall variable of _new_point rather than the global ncall of the sampling run.
That is not correct, is it ?

There is also a check here:

ucheck = self.since_update >= self.update_interval

But this relies on since_update which was set inside _new_point.

from dynesty.

joshspeagle avatar joshspeagle commented on June 11, 2024

So the logic for both of these was a bit hacky, but essentially if you initialize your multi-ellipsoidal bounds too early over a uniform distribution you run the risk of shredding the posterior and making sampling inefficient/creating tons of islands. So the default behaviour was to wait a bit before the first update by just sampling from the cube.

In terms of the _beyond_unit_bound functionality, that was also hacky to try and just repeat sampling if we somehow end up proposing outside of the priors because of our bounds (which can happen depending on the expansion factor, etc.).

I still do not understand why default ellipsoid centers/covariances are used at all for sampling. I thought they would always be updated before the run based on current points.

I also thought this is what should be happening, so I was a bit surprised to see it wasn't triggering properly.

This lines implies that the boundary update will be done based on local ncall variable of _new_point rather than the global ncall of the sampling run. That is not correct, is it ?

So IIRC, one of these is because in earlier iterations where the bounding was unstable, you could propose a terrible bound and then you kinda were stuck. So that might have been included to trigger an pre-emptive update to avoid this from happening.

Not sure about the second check...

from dynesty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.