Skip to content

Commit 1706c96

Browse files
authored
Merge branch 'master' into feat/skorch-compatible
2 parents 4552e91 + 96bdf12 commit 1706c96

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

benchmark/data_frame_text_benchmark.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@ def main_torch(
457457

458458
if dataset.task_type == TaskType.BINARY_CLASSIFICATION:
459459
out_channels = 1
460-
loss_fun = BCEWithLogitsLoss()
460+
label_imbalance = sum(train_tensor_frame.y) / len(train_tensor_frame.y)
461+
loss_fun = BCEWithLogitsLoss(pos_weight=1 / label_imbalance)
461462
metric_computer = AUROC(task='binary').to(device)
462463
higher_is_better = True
463464
elif dataset.task_type == TaskType.MULTICLASS_CLASSIFICATION:

0 commit comments

Comments
 (0)