Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix accuracy computation in Reporter #195

Merged
merged 2 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix auroc call
  • Loading branch information
AlexTMallen committed Apr 16, 2023
commit f12515eb93952d267834a7675282e627601816f9
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ elk/trained/*
nohup.out
.idea
*.pkl
.vscode/launch.json
elk/experiment_results.ipynb
elk/training/loss_api.py
prototyping.ipynb
run.sh
dummy/

# scripts for experiments in progress
my_*.sh
Expand Down
3 changes: 1 addition & 2 deletions elk/training/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,10 @@ def score(self, labels: Tensor, hiddens: Tensor) -> EvalResult:
cal_err = 0.0

Y_one_hot = to_one_hot(Y, c).long().flatten()
roc_auc_ci(Y_one_hot.cpu(), logits.cpu().flatten())
auroc_result = roc_auc_ci(Y_one_hot, logits.flatten())

raw_preds = logits.argmax(dim=-1).long()
raw_acc = accuracy(Y, raw_preds.flatten())
auroc_result = roc_auc_ci(Y, logits.flatten())
return EvalResult(
auroc=auroc_result.estimate,
auroc_lower=auroc_result.lower,
Expand Down