-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blind output with user-provided offsets #10
base: main
Are you sure you want to change the base?
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 = True
in the[output]
section of the parameter file. The offsets are saved as a .npy file. Addblinding_offsets = /path/to/file
to the parameter file.Caveat: The user must set the offsets corresponding to output columns such as
prior like post weight
to 0 manually.The modification is mostly copied from @MCostanzi.