pytorch
c77857cb - Improve numerical stability of `torch.distributions.wishart.Wishart` (#72993)

Commit
2 years ago
Improve numerical stability of `torch.distributions.wishart.Wishart` (#72993) Summary: Maintanance of https://github.com/pytorch/pytorch/pull/70377 Multiple modifications of the merged initial implementation of Wishart distribution. Key modifications: * torch/distributions/wishart.py: Clamp (Clip) float type values to calculate reciprocal in numerically stable manner, by using the eps value paired to each torch.dtype * test/distributions/test_distributions.py: Test Wishart distribution implementation in numerically unstable zones, i.e df values are at ndim - 1 < df < ndim where ndim is the one dimenstion of the Wishart parameter & sample matrix. Re-opened reverted PR https://github.com/pytorch/pytorch/issues/72059 cc neerajprad vadimkantorov Pull Request resolved: https://github.com/pytorch/pytorch/pull/72993 Reviewed By: samdow Differential Revision: D34853807 Pulled By: neerajprad fbshipit-source-id: eb62dca19bf8a934fdf59b4ffc58587447fe8378 (cherry picked from commit 99240c0d947e2faeb7beae91164ede41f61d8448)
Author
Committer
Parents
Loading