Skip to content

Commit

Permalink
Small fix for accuracy calculation for bert models
Browse files Browse the repository at this point in the history
  • Loading branch information
advaithsrao committed Nov 26, 2023
1 parent 1cea7e8 commit 38060b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions detector/modeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def train(
# logits = logits.detach().cpu().numpy()
# label_ids = b_labels.detach().cpu().numpy()

total_eval_accuracy += self.accuracy(logits, label_ids)
total_eval_accuracy += self.accuracy(logits, b_labels)

avg_val_accuracy = total_eval_accuracy / len(validation_dataloader)
print(f'Validation Accuracy: {avg_val_accuracy:.4f}')
Expand Down Expand Up @@ -475,7 +475,7 @@ def train(
# logits = logits.detach().cpu().numpy()
# label_ids = b_labels.detach().cpu().numpy()

total_eval_accuracy += self.accuracy(logits, label_ids)
total_eval_accuracy += self.accuracy(logits, b_labels)

avg_val_accuracy = total_eval_accuracy / len(validation_dataloader)
print(f'Validation Accuracy: {avg_val_accuracy:.4f}')
Expand Down

0 comments on commit 38060b7

Please sign in to comment.