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

Unsupervised dataset RunTime error (setting the debiased_loss=False and ignore_target_labels=True) #29

Open
agiannoul opened this issue Mar 1, 2023 · 0 comments

Comments

@agiannoul
Copy link

agiannoul commented Mar 1, 2023

For unsupervised datasets and setting the parameters
debiased_loss=False
ignore_source_labels=True
ignore_target_labels=True

the code in file distance.py lines 300-303 will run:

if (targets2 is None) or self.ignore_target_labels:
    reindex_start = len(self.V1) if (self.loss == 'sinkhorn' and self.debiased_loss) else True
    X, Y_infer, Y_true = self._load_infer_labels(D2, classes2, reindex=True, reindex_start=reindex_start)
    self.targets2 = targets2 = Y_infer - reindex_start

Which results in RuntimeError: Subtraction, the - operator, with a bool tensor is not supported, because of
Y_infer - reindex_start (I think that in line 301 instead of True maybe the correct is 0 ?

changes to:
reindex_start = len(self.V1) if (self.loss == 'sinkhorn' and self.debiased_loss) else 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant