-
Notifications
You must be signed in to change notification settings - Fork 57
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
Small possible bug #14
Comments
Hi there, I found the same bug when running one class per task using iCaRL for example. The bug here seems to happen because of the function Try the follow code again ! :)
|
No, this is not the same bug. I will give an example. Suppose Then, what I tried to explain in the other message will happen: What I'm pointing out is that this conversion does not change the variable |
In the evaluate() function, on agents/base.py, after line 171:
_, pred_label = dists.min(1)
Shouldn't there be a:
pred_label = torch.tensor(self.old_labels, dtype=batch_y.dtype, device=batch_y.device)[pred_label]
Right after 171? Otherwise the error_analysis part of this function, which uses pred_label to see which are the examples assigned to old classes vs new classes, will use a pred_label value that will make no sense in that case.
Then, to make the rest of the code consistent after my suggested addition, lines 175, 176:
correct_cnt = (np.array(self.old_labels)[ pred_label.tolist()] == batch_y.cpu().numpy()).sum().item() / batch_y.size(0)
Would have to be changed to:
correct_cnt = (pred_label == batch_y).sum().item() / batch_y.size(0)
The text was updated successfully, but these errors were encountered: