Attend the Women in ML Symposium on December 7 Register now

tfg.nn.metric.intersection_over_union.evaluate

Stay organized with collections Save and categorize content based on your preferences.

Computes the Intersection-Over-Union metric for the given ground truth and predicted labels.

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

ground_truth_labels A tensor of shape [A1, ..., An, G1, ..., Gm], where the last m axes represent a grid of ground truth attributes. Each attribute can either be 0 or 1.
predicted_labels A tensor of shape [A1, ..., An, G1, ..., Gm], where the last m axes represent a grid of predicted attributes. Each attribute can either be 0 or 1.
grid_size The number of grid dimensions. Defaults to 1.
name A name for this op. Defaults to "intersection_over_union_evaluate".

A tensor of shape [A1, ..., An] that stores the intersection-over-union metric of the given ground truth labels and predictions.

ValueError if the shape of ground_truth_labels, predicted_labels is not supported.