mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-20 14:20:38 +08:00
Use sample_pdf from PyTorch3D in NeRF
Summary: Use PyTorch3D's new faster sample_pdf function instead of local Python implementation. Also clarify deps for the Python implementation. Reviewed By: gkioxari Differential Revision: D30512109 fbshipit-source-id: 84cfdc00313fada37a6b29837de96f6a4646434f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d2bbd0cdb7
commit
1251446383
@@ -75,14 +75,15 @@ def sample_pdf_python(
|
||||
This is a pure python implementation of the `sample_pdf` function.
|
||||
It may be faster than sample_pdf when the number of bins is very large,
|
||||
because it behaves as O(batchsize * [n_bins + log(n_bins) * n_samples] )
|
||||
whereas sample_pdf behaves as O(batchsize * n_bins * n_samples).
|
||||
whereas sample_pdf behaves as O(batchsize * n_bins * n_samples).
|
||||
For 64 bins sample_pdf is much faster.
|
||||
|
||||
Samples probability density functions defined by bin edges `bins` and
|
||||
the non-negative per-bin probabilities `weights`.
|
||||
|
||||
Note: This is a direct conversion of the TensorFlow function from the original
|
||||
release [1] to PyTorch.
|
||||
release [1] to PyTorch. It requires PyTorch 1.6 or greater due to the use of
|
||||
torch.searchsorted.
|
||||
|
||||
Args:
|
||||
bins: Tensor of shape `(..., n_bins+1)` denoting the edges of the sampling bins.
|
||||
|
||||
Reference in New Issue
Block a user