Skip to content

Commit

Permalink
Indentation error?
Browse files Browse the repository at this point in the history
  • Loading branch information
AngledLuffa committed Dec 24, 2023
1 parent 71be815 commit 091dcdf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def configure_weighted_loss(self, label_decoder: Mapping, counts: Mapping):
total_samples = sum(counts.values())
for class_idx in counts:
weights[class_idx] = total_samples / (counts[class_idx] * len(counts)) # weight_i = total / (# examples in class i * num classes)
weights = torch.tensor(weights)
weights = torch.tensor(weights)
logging.info(f"Using weights {weights} for weighted loss.")
self.criterion = nn.BCEWithLogitsLoss(weight=weights)

Expand Down

0 comments on commit 091dcdf

Please sign in to comment.