mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-12 19:04:03 +08:00
Fix non stratified PDF sampling (#571)
This commit is contained in:
1 parent
cf34ef4bd0
commit
c2b5671018
1 file changed
+2
-1
@@ -349,7 +349,8 @@ class PDFSampler(Sampler):
|
||||
u = u + torch.rand(size=(*cdf.shape[:-1], num_bins), device=cdf.device) / num_bins
|
||||
else:
|
||||
# Uniform samples between 0 and 1
|
||||
u = torch.linspace(0.0, 1.0, steps=num_bins, device=cdf.device)
|
||||
u = torch.linspace(0.0, 1.0 - (1.0 / num_bins), steps=num_bins, device=cdf.device)
|
||||
u = u + 1.0 / (2 * num_bins)
|
||||
u = u.expand(size=(*cdf.shape[:-1], num_bins))
|
||||
u = u.contiguous()
|
||||
|
||||
|
||||
Reference in new issue
Block a user