mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-03 14:28:41 +08:00
Stricter typing, update docstrings (#226)
This commit is contained in:
1 parent
395b03f48c
commit
44a7fa288c
10 files changed
+181
-181
No files matched your search
@@ -20,7 +20,9 @@ from torchtyping import TensorType
|
||||
from nerfactory.cameras.rays import RaySamples
|
||||
|
||||
|
||||
def distortion_loss(ray_samples: RaySamples, densities: TensorType[..., "num_samples", 1]) -> TensorType[..., 1]:
|
||||
def distortion_loss(
|
||||
ray_samples: RaySamples, densities: TensorType["bs":..., "num_samples", 1]
|
||||
) -> TensorType["bs":..., 1]:
|
||||
"""Ray baserd distortion loss proposed in MipNeRF-360.
|
||||
|
||||
.. math::
|
||||
@@ -32,11 +34,11 @@ def distortion_loss(ray_samples: RaySamples, densities: TensorType[..., "num_sam
|
||||
is the weight at location :math:`u` between bin locations :math:`s_i` and :math:`s_{i+1}`.
|
||||
|
||||
Args:
|
||||
ray_samples (RaySamples): Ray samples to compute loss over
|
||||
densities (TensorType[..., "num_samples", 1]): Predicted sample densities
|
||||
ray_samples: Ray samples to compute loss over
|
||||
densities: Predicted sample densities
|
||||
|
||||
Returns:
|
||||
TensorType[..., 1]: Distortion Loss.
|
||||
Distortion Loss.
|
||||
"""
|
||||
|
||||
# Compute the weight at each sample location
|
||||
|
||||
Reference in new issue
Block a user