This PR introduces a few performance optimizations related to distribution sampling. This includes:
Using the a binary search algorithm to search through weights for each simple, instead of the linear search algorithm previously used in the _run_mixture() internal function (samplers.py module).
Using numpy's vectorized functions np.maximum() and np.minimum() to enforce left and right clipping.
This PR introduces a few performance optimizations related to distribution sampling. This includes:
_run_mixture()
internal function (samplers.py
module).np.maximum()
andnp.minimum()
to enforce left and right clipping.