Hi, guys
I am doing a project related to KDD99 dataset. After some data processing, I was able to represent the dataset as a matrix with (125973,123) dimension with ‘label’ of 5 classifications(range 0-4). After normalization, I get a matrix shown below:(each row is treated as one training example, each column is treated as one feature(excluding ‘label’ column))
Then I found some existing code from other project that I want to use, but the project is dealing with FashionMNIST dataset which is a built-in dataset that can be directly accessed using interface functions.
So I am kinda stuck and don’t know how to code to load my dataset to Dataloader() in same fashion so that I can use existing code.
I’d really appreciate if someone can point me the right direction.
Basically, you inherit from the PyTorch Dataset class and you implement the __getitem__ and __len__ methods. __getitem__ is called to extract batch tensors and __len__ determines the number of elements in the dataset. After that, use the PyTorch DataLoader like in your example with your own dataset and everything should work fine!