Skip to content

Commit

Permalink
dev: now drop 0 targets events for validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Billy Li committed Jul 17, 2024
1 parent 16f6d70 commit ead4721
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ def compute_metrics(self, jet_predictions, particle_scores, stacked_targets, sta
# early stopping, hyperparameter optimization, learning rate scheduling, etc.
metrics["validation_accuracy"] = metrics[f"jet/accuracy_{num_targets}_of_{num_targets}"]

weighted_avg_jet_accuracy = weighted_jet_accuracies / tot_target_weights
metrics["validation_average_jet_accuracy"] = np.nanmean(weighted_avg_jet_accuracy)
has_targets = tot_target_weights > 0
weighted_avg_jet_accuracy = weighted_jet_accuracies[has_targets] / tot_target_weights[has_targets]
metrics["validation_average_jet_accuracy"] = np.mean(weighted_avg_jet_accuracy)

return metrics

Expand Down

0 comments on commit ead4721

Please sign in to comment.