Skip to content

Commit

Permalink
fix bug where val_ds still has augmentations turned on
Browse files Browse the repository at this point in the history
  • Loading branch information
aaprasad committed Aug 30, 2024
1 parent 1680ab7 commit 5fb8256
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dreem/datasets/tracking_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def make_train_splits(self, splits: tuple[float]) -> None:

if train_frac != 0:
dataset_to_split = copy(train_ds)
dataset_to_split.augmentations = None
dataset_size = len(dataset_to_split)
train_inds, val_inds = train_test_split(
range(dataset_size),
Expand All @@ -117,12 +118,10 @@ def make_train_splits(self, splits: tuple[float]) -> None:

if len(test_inds) != 0:
test_ds = Subset(dataset_to_split, test_inds)
test_ds.dataset.augmentations = None
else:
test_ds = None

val_ds = Subset(dataset_to_split, val_inds)
val_ds.dataset.augmentations = None

train_ds = Subset(train_ds, train_inds)

Expand Down

0 comments on commit 5fb8256

Please sign in to comment.