class composer.metrics.MaskedAccuracy(ignore_index=- 100, dist_sync_on_step=False)[source]#

Computes accuracy with support for masked indices.

Adds metric state variables:

correct (float): The number of instances where the prediction masked the target. total (float): The number of total instances that were predicted.

  • ignore_index (int) โ€“ The class index to ignore. Default: -100.

  • dist_sync_on_step (bool, optional) โ€“ Synchronize metric state across processes at each forward() before returning the value at the step. Default: False.