SearchAccuracy

class easypl.metrics.classification.search_accuracy.SearchAccuracy(k: Union[int, List] = 1, batch_size: int = 512, distance: Union[str, Callable] = 'L2', largest: bool = True, dist_sync_on_step: bool = False, compute_on_step: bool = True)

Version of accuracy for search case

k

SearchAccuracy return top k (top (k[0], k[1], …) if k is list) accuracy rate.

Type:

Union[int, List]

batch_size

Batch size for evaluate distance operations.

Type:

int

distance

Name or function of distance.

Type:

Union[str, Callable]

largest

If True metric evaluate top largest samples, else evaluate smallest samples.

Type:

bool