Blind output with user-provided offsets#10
Blind output with user-provided offsets#10SebastianBocquet wants to merge 3 commits intocosmosis-developers:mainfrom
Conversation
|
Sorry, should have run the tests offline first... Sampling works but the tests don't. I'll take a closer look. |
|
It looks like this is because the blinding is not working for the in-memory output format. |
|
I applied the same modification to in_memory_output.py and the tests now pass. However, my changes to output_base will still break other output methods (which are not covered by the tests). |
|
Please let me know if you like the modification / blind scheme at all. If so, I can modify the other output options, too. If not, there's no point. |
|
It just occurred to me that offsetting the output makes resuming a chain from that output impossible. I guess cosmosis could unblind the chain internally and resume from there. I haven't looked at the code yet. We should probably fix that before merging. |
|
Ouch, yes, this is difficult! We could unblind on loading the chain in the |
|
I could add an error when trying to |
|
It feels like we should do something a bit more organized, and modify the way that the chains are being resumed by adding a method to read a chain and detect if it has been blinded by looking at the header / metadata. Let me think about this! |
Let the user provide a set of parameter offsets for the purpose of blinding the output. This makes looking at the chains safe!
This is activated by setting
apply_blinding_offsets = Truein the[output]section of the parameter file. The offsets are saved as a .npy file. Addblinding_offsets = /path/to/fileto the parameter file.Caveat: The user must set the offsets corresponding to output columns such as
prior like post weightto 0 manually.The modification is mostly copied from @MCostanzi.