toshas / torch_truncnorm

Truncated Normal Distribution in PyTorch
BSD 3-Clause "New" or "Revised" License
79 stars 13 forks source link

Fix for _lbpp_m_lpaa_d_Z calculation when distribution is unbounded on either side #5

Closed JJMorton closed 3 years ago

JJMorton commented 3 years ago

torch.nan_to_num replaces infinities in a and b with finite values, making their multiplication with little_phi (which is zero for this case) correctly return zero in the calculation of self._lpbb_m_lpaa_d_Z

toshas commented 3 years ago

Thanks!