Skip to content

Commit

Permalink
Randomly shuffle cached data files when loading them in (#1076)
Browse files Browse the repository at this point in the history
  • Loading branch information
timwhite0 authored Oct 7, 2024
1 parent 0e565b1 commit 4694457
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bliss/cached_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ def _load_file_paths_and_slices(self):
file_names = [
f for f in sorted(os.listdir(str(self.cached_data_path))) if f.endswith(".pt")
]
random.shuffle(file_names)
if self.subset_fraction:
file_names = file_names[: math.ceil(len(file_names) * self.subset_fraction)]
self.file_paths = [os.path.join(str(self.cached_data_path), f) for f in file_names]
Expand Down

0 comments on commit 4694457

Please sign in to comment.