View source on GitHub |
Sample points on a ray using inverse transform stratified sampling.
tfg.geometry.representation.ray.sample_inverse_transform_stratified_1d(
ray_org: TensorLike,
ray_dir: TensorLike,
z_values_init: TensorLike,
weights_init: TensorLike,
n_samples: int,
combine_z_values=True,
name: str = 'sample_inverse_transform_stratified_1d'
)
The rays are defined by their origin and direction. Along each ray, there are M samples (provided as 1D distances from the ray origin) and the corresponding weights (probabilities) that facilitate the inverse transform sampling.
Returns | |
---|---|
A tensor of shape [A1, ..., An, M, 3] indicating the M points on the ray
and a tensor of shape [A1, ..., An, M] for the Z values on the points.
|