Skip to content

Enable using multiple and multi-banded ROQ bases

Soichiro Morisaki requested to merge soichiro/bilby:multiple_roq into master

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 property basis_number_linear/quadratic specifies which basis should be used, and is automatically updated based on self.parameters.
  • self.weights contains frequency_nodes_linear/quadratic, which is a list of ndarrays of frequency nodes. When self.waveform_generator is called, its frequency nodes is automatically updated to self.weights["frequency_nodes_linear/quadratic"][self.basis_number_linear/quadratic].
  • self.weights contains prior_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.

cc: @colm.talbot @rory-smith @hong-qi

Edited by Soichiro Morisaki

Merge request reports

Loading