0

Assume I have train/valid/test dataset with batch_size and shuffleed as normal.

When I do train/valid/test, I want to sample a certain number (called memory_size) of new samples from the entire dataset for each sample.

For example, I set batch_size as 256, let dataset shuffled, and memory_size as 80. In every forward step, not only use each sample from dataset, but sample data from entire original dataset which size is memory_size and I want to use it inside forward. Let new samples as Memory (Yeah, I want to adopt idea from Memory Networks). Memory can be overlapped between each sample in train set.

I'm using PyTorch and PyTorch-Lightning. Can I create new memory dataloader per each train_dataloader, val_dataloader, and test_dataloader then load it with original dataloader? or is there a better way to achieve what I want?

Jongsu Liam Kim
  • 717
  • 1
  • 7
  • 23

0 Answers0