Skip to content

Commit

Permalink
BalancedBatchSampler reshuffle bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
adambielski authored Mar 10, 2018
1 parent 1f7c515 commit 296164d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def __iter__(self):
self.used_label_indices_count[class_]:self.used_label_indices_count[
class_] + self.n_samples])
self.used_label_indices_count[class_] += self.n_samples
if self.used_label_indices_count[class_] + self.n_samples < len(self.label_to_indices[class_]):
if self.used_label_indices_count[class_] + self.n_samples > len(self.label_to_indices[class_]):
np.random.shuffle(self.label_to_indices[class_])
self.used_label_indices_count[class_] = 0
yield indices
Expand Down

0 comments on commit 296164d

Please sign in to comment.