espnet.nets.pytorch_backend.nets_utils.th_accuracy
Less than 1 minute
espnet.nets.pytorch_backend.nets_utils.th_accuracy
espnet.nets.pytorch_backend.nets_utils.th_accuracy(pad_outputs, pad_targets, ignore_label)
Calculate accuracy.
- Parameters:
- pad_outputs (Tensor) – Prediction tensors (B * Lmax, D).
- pad_targets (LongTensor) – Target label tensors (B, Lmax, D).
- ignore_label (int) – Ignore label id.
- Returns: Accuracy value (0.0 - 1.0).
- Return type: float