I want to call a function defined in my dataset class at the end of every epoch of training. I’m not sure if it’s the right thing to do and I wanted some feedback. The current structure looks something like below:
class my_dataset(nn.data.utils.Dataset):
    __init__(self, ...)
    __len__(self)
    __getitem__(self, idx)
    my_func(self)
data = my_dataset()
data_loader = torch.utils.data.DataLoader(data)
def training():
    for i, sample in enumerate(train_loader):
        do something
    data.my_func()

I know that I can call data.my_func() but will it be reflected in the data_loader ? I guess I’m trying to copy the on_epoch_end function provided in the Keras Dataset structure. Is this the right way to do it ?
Thanks !