Skip to content

Commit

Permalink
remove sync_dist due to overhead
Browse files Browse the repository at this point in the history
  • Loading branch information
ejm714 committed Nov 1, 2022
1 parent 8357e79 commit 12ddfe5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions zamba/pytorch_lightning/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ def compute_and_log_metrics(
self.log(
f"{subset}_macro_f1",
f1_score(y_true, y_pred, average="macro", zero_division=0),
sync_dist=True,
)

# if only two classes, skip top_k accuracy since not enough classes
Expand All @@ -220,10 +219,9 @@ def compute_and_log_metrics(
labels=np.arange(y_proba.shape[1]),
k=k,
),
sync_dist=True,
)
else:
self.log(f"{subset}_accuracy", accuracy_score(y_true, y_pred), sync_dist=True)
self.log(f"{subset}_accuracy", accuracy_score(y_true, y_pred))

for metric_name, label, metric in compute_species_specific_metrics(
y_true, y_pred, self.species
Expand Down

0 comments on commit 12ddfe5

Please sign in to comment.