Enable using multiple and multi-banded ROQ bases
This patch enables using multiple ROQ bases in a single PE run and computing ROQ weights from multi-banded bases. The new file format of ROQ basis and weights for this code change is described here. We discussed this new file format in a PE call and decided to continue discussions in this MR. This code change does not break the workflow of using conventional .npy bases, .npz weights or .json weights.
The main code changes are summarized below:
-
self.weights["{ifo}_linear/quadratic"]
is now not a single ndarray of ROQ weights but a list of ndarrays for the use of multiple ROQ bases. The propertybasis_number_linear/quadratic
specifies which basis should be used, and is automatically updated based onself.parameters
. -
self.weights
containsfrequency_nodes_linear/quadratic
, which is a list of ndarrays of frequency nodes. Whenself.waveform_generator
is called, its frequency nodes is automatically updated toself.weights["frequency_nodes_linear/quadratic"][self.basis_number_linear/quadratic]
. -
self.weights
containsprior_range_linear/quadratic
as it is necessary information to determine which basis should be used for a likelihood evaluation. - Only weights with the .hdf5 format can contain multiple weights. If another format is used for multiple weights, ValueError is raised.
- Basis numbers and frequency nodes are not updated when
self.parameters
is the same as cached parameters or only a single basis is used. - If conventional .npy basis, .npz weight or .json weight is passed, the likelihood automatically assumes it uses only a single basis.
-
_set_weights_linear/quadratic_multiband
are implemented to compute ROQ weights from multibanded bases using the algorithm introduced in arXiv:2104.07813. -
roq_params
are automatically retrieved from .hdf5 basis if not specified.
Merge request reports
Activity
added Likelihood label
- Resolved by Soichiro Morisaki
I just took an initial look. I think I'll have more specific requests later, but in order to merge this, it needs unit testing for all of the new features.
I think we needs tests that:
- the new file format can be read.
- the correct number of bases are loaded based on the provided priors
- the likelihood agrees with the non-ROQ case
Can you put together a small multi-basis file for single and multi-banded?
Edited by Colm Talbot
added 13 commits
-
782ab4ef...84675b8e - 10 commits from branch
lscsoft:master
- eb97ab94 - bilby/gw/likelihood.py: make ROQGravitationalWaveTransient compatible with the new .hdf5 ROQ format
- f474e369 - follow naming convention in spec doc
- cb5ea513 - add unit test for multiple-multibanded-ROQ
Toggle commit list-
782ab4ef...84675b8e - 10 commits from branch
added 1 commit
- ec203b6d - bilby/gw/likelihood/roq.py: add doc string for parameter_conversion
added 6 commits
- 42ee3a03 - bilby/gw/likelihood.py: make ROQGravitationalWaveTransient compatible with the new .hdf5 ROQ format
- 819dac78 - follow naming convention in spec doc
- cc134f40 - add unit test for multiple-multibanded-ROQ
- 074a9da7 - bilby/gw/likelihood/roq.py: add doc string for parameter_conversion
- 44550d62 - bilby/gw/likelihood/roq.py: retrieve roq_params from .hdf5 basis file
- a6e8a295 - test/gw/likelihood_test.py: add more cases for TestROQLikelihoodHDF5
Toggle commit listHi @colm.talbot , I am just checking in with the status of review of this MR. If you could give us any suggestions/comments/caveats etc., it would be very helpful for us, and I am happy to address them. Thank you!
- Automatically resolved by Soichiro Morisaki
Is there any way the hdf5 files can be stored on the test images rather than in the repository? This is currently done in https://git.ligo.org/lscsoft/bilby/-/blob/master/containers/dockerfile-template#L61-L67.
- Automatically resolved by Soichiro Morisaki
- Automatically resolved by Soichiro Morisaki
- Resolved by Soichiro Morisaki
added 6 commits
- 0b795a92 - bilby/gw/likelihood.py: make ROQGravitationalWaveTransient compatible with the new .hdf5 ROQ format
- 16e599a3 - follow naming convention in spec doc
- 2bed8de1 - add unit test for multiple-multibanded-ROQ
- 71d56b77 - bilby/gw/likelihood/roq.py: add doc string for parameter_conversion
- a66cad6a - bilby/gw/likelihood/roq.py: retrieve roq_params from .hdf5 basis file
- 7888afa4 - test/gw/likelihood_test.py: add more cases for TestROQLikelihoodHDF5
Toggle commit listadded 6 commits
- 12fbf829 - bilby/gw/likelihood.py: make ROQGravitationalWaveTransient compatible with the new .hdf5 ROQ format
- e0aca1b7 - follow naming convention in spec doc
- 8358f3d3 - add unit test for multiple-multibanded-ROQ
- 5b706502 - bilby/gw/likelihood/roq.py: add doc string for parameter_conversion
- ad6716d2 - bilby/gw/likelihood/roq.py: retrieve roq_params from .hdf5 basis file
- 2893f328 - test/gw/likelihood_test.py: add more cases for TestROQLikelihoodHDF5
Toggle commit list