tfg.nn.loss.chamfer_distance.evaluate

Computes the Chamfer distance for the given two point sets.

This is a symmetric version of the Chamfer distance, calculated as the sum of the average minimum distance from point_set_a to point_set_b and vice versa. The average minimum distance from one point set to another is calculated as the average of the distances between the points in the first set and their closest point in the second set, and is thus not symmetrical.

This function returns the exact Chamfer distance and not an approximation.

In the following, A1 to An are optional batch dimensions, which must be broadcast compatible.

point_set_a A tensor of shape [A1, ..., An, N, D], where the last axis represents points in a D dimensional space.
point_set_b A tensor of shape [A1, ..., An, M, D], where the last axis represents points in a D dimensional space.
name A name for this op. Defaults to "chamfer_distance_evaluate".

A tensor of shape [A1, ..., An] storing the chamfer distance between the two point sets.

ValueError if the shape of point_set_a, point_set_b is not supported.