You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In ELR/data_loader/cifar10.py, line 17 in this page, after self.train_labels[idx]=5, the indices of class '5' is enlarged because some labels in class '3' are switched to class '5'. While in the following iterations where i=5, line 4 will select the changed train_labels which equal '5'.
Then a larger set of examples with label '5' will be selected than expected, which results in that more examples being assigned with label '3' after executing the command in line 20.
I assume that if we set the percent = 0.5, after the label flipping step, we will get 12.5% examples with label '3' and 7.5% examples with label '5'. I am wondering if my understanding is right? Or maybe I just misunderstand your code. I would appreciate it very much if you could spare time to respond to my concerns.
1. def asymmetric_noise(self):
2. self.train_labels_gt = self.train_labels.copy()
3. for i in range(self.num_classes):
4. indices = np.where(self.train_labels == i)[0]
5. np.random.shuffle(indices)
6. for j, idx in enumerate(indices):
7. if j < self.cfg_trainer['percent'] * len(indices):
8. self.noise_indx.append(idx)
9. # truck -> automobile
10. if i == 9:
11. self.train_labels[idx] = 1
12. # bird -> airplane
13. elif i == 2:
14. self.train_labels[idx] = 0
15. # cat -> dog
16. elif i == 3:
17. self.train_labels[idx] = 5
18. # dog -> cat
19. elif i == 5:
20. self.train_labels[idx] = 3
21. # deer -> horse
22. elif i == 4:
23. self.train_labels[idx] = 7
The text was updated successfully, but these errors were encountered:
Hi, thanks for your inspiring work.
In ELR/data_loader/cifar10.py, line 17 in this page, after self.train_labels[idx]=5, the indices of class '5' is enlarged because some labels in class '3' are switched to class '5'. While in the following iterations where i=5, line 4 will select the changed train_labels which equal '5'.
Then a larger set of examples with label '5' will be selected than expected, which results in that more examples being assigned with label '3' after executing the command in line 20.
I assume that if we set the percent = 0.5, after the label flipping step, we will get 12.5% examples with label '3' and 7.5% examples with label '5'. I am wondering if my understanding is right? Or maybe I just misunderstand your code. I would appreciate it very much if you could spare time to respond to my concerns.
The text was updated successfully, but these errors were encountered: