core.density.interpolation.interpolated_sample_and_log_prob_multi

core.density.interpolation.interpolated_sample_and_log_prob_multi(
    sample_points,
    values,
    num_processes=1,
)

Given a distribution discretized on a grid, return a sample and the log prob from an interpolated distribution. Wraps the bilby.core.prior.Interped class. Works with multiprocessing.

Parameters

Name Type Description Default
sample_points (np.ndarray, shape(N)) x values for samples required
values (np.ndarray, shape(B, N)) y values for samples. The distributions do not have to be initially normalized, although the final log_probs will be. B = batch dimension. required
num_processes int Number of parallel processes to use. 1

Returns

Name Type Description
(np.ndarray, np.ndarray) : sample and log_prob arrays, each of length B