Skip to content

Conversation

@fzeiser
Copy link
Collaborator

@fzeiser fzeiser commented Dec 8, 2020

Started on how to pass the lnlike cutoff parameter from gambit to gledeli

@anderkve: Could you have a look at the NuclearBit.cpp (and headerfile) and code up the rest, so how one gets the lnlike cutoff parameter from the settings?

@fzeiser fzeiser added the enhancement New feature or request label Dec 8, 2020
…in NuclearBit. The value of this option is passed into the "set_lnlike_cutoff" function in the gledeli backend. Updated NuclearBit_demo.yaml to use this and ignore the "model_invalid_for_lnlike_below" YAML option.

	modified:   Backends/include/gambit/Backends/frontends/gledeliBE_1_0.hpp
	modified:   NuclearBit/include/gambit/NuclearBit/NuclearBit_rollcall.hpp
	modified:   NuclearBit/src/NuclearBit.cpp
	modified:   yaml_files/NuclearBit_demo.yaml
	modified:   NuclearBit/src/NuclearBit.cpp
…_results["valid_point"] = false.

	modified:   NuclearBit/src/NuclearBit.cpp
@anderkve
Copy link
Owner

This turned out to be a bit more involved than I thought, because passing info from the "KeyValues" section in the YAML file to specific GAMBIT module functions really broke the GAMBIT design.* So in the end I figured it was easier just to add a YAML option "lnlike_cutoff" specific for our NuclearBit function. This is now demonstrated in NuclearBit_demo.yaml. I've commented out the standard GAMBIT option "model_invalid_for_lnlike_below". (This means that internally this value is set to a default which is 0.9*, so that should never affect anything.)

So now it's completely up to NuclearBit / gledeli to invalidate points with too low lnlike. This should now work as long as the get_results function in gledeliBE.py always includes a boolean entry results["valid_point"] in the results dictionary it sends back to GAMBIT. I didn't implement this in gledeliBE, as I had some other issues preventing me from testing it. Can you try adding that and test that the cutoff works as expected?

*We are sort of breaking the GAMBIT design by having a single backend code evaluating a bunch of independent likelihood contributions, and tracking internally when/if a point falls below the cutoff. The design of GAMBIT rather expects that individual likelihood contributions are reported back to GAMBIT and that the GAMBIT core keeps track of when/if a point falls under the threshold. Hence the values in KeyValues were never intended to be shared with the module functions in the different Bits.

@fzeiser
Copy link
Collaborator Author

fzeiser commented Jan 29, 2021

Thanks, I'll test it!

I see you point about breaking GAMBIT's design, but I would propose to continue. Unless we want to turn fully GAMBIT, we're for now just using it to demonstrate gledeli. I also think that this is a likely usecase scenario for "external" users who may just want to use a very limited set of GAMBIT's functionality.

@anderkve
Copy link
Owner

I see you point about breaking GAMBIT's design, but I would propose to continue. Unless we want to turn fully GAMBIT, we're for now just using it to demonstrate gledeli. I also think that this is a likely usecase scenario for "external" users who may just want to use a very limited set of GAMBIT's functionality.

I completely agree -- I just wanted to explain why something that should have been simple turned out not be. :)
It's actually something I'll take note of for future GAMBIT development. It might be nice to have a simple way to give all parts of GAMBIT access to all info in the yaml file, even though (for safety/consistency) it typically shouldn't be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants