ott.geometry.low_rank.LRCGeometry.compute_max_cost

ott.geometry.low_rank.LRCGeometry.compute_max_cost#

LRCGeometry.compute_max_cost()[source]#

Compute the maximum of the cost_matrix.

Three cases are taken into account:

  • If the number of samples of cost_1 and cost_2 are both smaller than 1024 and if batch_size is None, the cost_matrix is computed to obtain its maximum entry.

  • If one of the number of samples of cost_1 or cost_2 is larger than 1024 and if batch_size is None, then the maximum of the cost matrix is calculated by batch. The batches are created on the longest axis of the cost matrix and their size is fixed to 1024.

  • If batch_size is provided as a float, then the maximum of the cost matrix is calculated by batch. The batches are created on the longest axis of the cost matrix and their size if fixed by batch_size.

Return type:

float

Returns:

Maximum of the cost matrix.