Data Loading through Sliding window in Pytorch

I have dataset(PAMAP2) as CSV file for implementing Human Activity Recognition. I was wondering how to load the data to a data loader using a sliding window of 2 seconds with a 50% overlap in PyTorch. I am trying to feed this particular data set to a CNN model for activity prediction.

If you are able to load the complete data into your RAM, this code snippet would give you a basic idea of a sliding window approach using a custom Dataset.

1 Like