Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use torch.long for multiclass classification labels #291

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
3 changes: 1 addition & 2 deletions birdset/datamodule/components/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def transform_labels(self, labels):
labels = torch.tensor(labels, dtype=torch.float16)

elif self.task == "multiclass":
labels = labels
labels = torch.tensor(labels, dtype=torch.long)

return labels

Expand Down Expand Up @@ -276,7 +276,6 @@ def transform_values(self, batch):
input_values = waveform_batch["input_values"]
input_values = input_values.unsqueeze(1)
labels = torch.tensor(batch["labels"])

if self.wave_aug:
input_values, labels = self._waveform_augmentation(input_values, labels)

Expand Down