utils.py

gnp.utils.smooth_values_by_gaussian(x: Tensor, values: Tensor, radius: float) Tensor[source]

Smooth values by a truncated Gaussian kernel over a given radius. This is used in simulating mean curvature flow.

Parameters:
  • x (torch.Tensor) -- Input data points

  • values (torch.Tensor) -- Values to be smoothed

  • radius (float) -- Radius for truncating the Gaussian kernel. The standard deviation of the Gaussian is set to one third of the radius.

Returns:

Smoothed values

Return type:

torch.Tensor

gnp.utils.subsample_points_by_radius(x: Tensor, radius: float) LongTensor[source]

Subsample points by radius. This is used in simulating mean curvature flow.

Parameters:
  • x (torch.Tensor) -- Points to subsample

  • radius (float) -- Radius for subsampling

Returns:

Indices of subsampled points

Return type:

torch.LongTensor