Spijkervet / CLMR

Official PyTorch implementation of Contrastive Learning of Musical Representations

Home Page:https://arxiv.org/abs/2103.09410

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

moules.linear_evaluation is missing parameters when calling Accuracy and AveragePrecision

fducau opened this issue · comments

When running the LinearEvaluation module I get the following error:

TypeError: Accuracy.__new__() missing 1 required positional argument: 'task'

and similar when calling torchmetrics.AveragePrecision without the task argument

Proposed solution

        self.accuracy = torchmetrics.Accuracy(
            task="multilabel",
            num_labels=output_dim
        )
        self.average_precision = torchmetrics.AveragePrecision(
            task='multilabel',
            num_labels=output_dim,
            pos_label=1
        )