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
andcost_2
are both smaller than 1024 and ifbatch_size
is None, thecost_matrix
is computed to obtain its maximum entry.If one of the number of samples of
cost_1
orcost_2
is larger than 1024 and ifbatch_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 bybatch_size
.
- Return type
- Returns
Maximum of the cost matrix.