How to load data from .dat files classified by folders

You could use DatasetFolder with a custom loader class which should be able to load the .dat format. This post shows how it’s done for numpy arrays.