diff --git a/.gitignore b/.gitignore index 82f9275..9972241 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,5 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + +datasets/ diff --git a/symbolic_nn_tests/dataloader.py b/symbolic_nn_tests/dataloader.py index 7a32563..0c78f14 100644 --- a/symbolic_nn_tests/dataloader.py +++ b/symbolic_nn_tests/dataloader.py @@ -1,10 +1,14 @@ +from pathlib import Path from torchvision.datasets import Caltech256 from torch.utils.data import random_split from torch.utils.data import BatchSampler +PROJECT_ROOT = Path(__file__).parent.parent + + def get_dataset(split: (float, float, float) = (0.7, 0.1, 0.2), *args, **kwargs): - ds = Caltech256("../datasets/", download=True) + ds = Caltech256(PROJECT_ROOT / "datasets/", download=True) train, test, val = ( BatchSampler(i, *args, **kwargs) for i in random_split(ds, split) )