From 0eabde7b532835ad83747422d40f1d9f913a2907 Mon Sep 17 00:00:00 2001 From: Julia Cohen Date: Mon, 16 Jun 2025 18:43:55 +0200 Subject: [PATCH] Added missing call to parent class super.init() --- pangaea/utils/losses.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pangaea/utils/losses.py b/pangaea/utils/losses.py index 5f6061a9..dcd155e1 100644 --- a/pangaea/utils/losses.py +++ b/pangaea/utils/losses.py @@ -4,6 +4,7 @@ class WeightedCrossEntropy(torch.nn.Module): def __init__(self, ignore_index: int, distribution: list[float]) -> None: + super(WeightedCrossEntropy, self).__init__() # Initialize the weights based on the given distribution self.weights = [1 / w for w in distribution]