my Problem is the following:
If I use the normal data loader for getting the training data loaded into the trainer.fit() routine, everything works fine. (validation step after each epoch)
However, when I create a custom batch sampler (pulling even amount of events from each class), inside the the trainer loop, only the training_step gets executed (behaviour here seems as expected).
The validation step then gets only executed in the initial validation check.
You can see my Batch sampler here (Susy1LeptonAnalysis/PytorchHelp.py at pytorch_tryout · frengelk/Susy1LeptonAnalysis · GitHub)
In the iter method, I create for each step_per_epoch (int, definded by me) an array of indices, which gets returned by
yield array here (last line of previous link, I can only put 2 links in my post).
The model is defined here:
(Same file as Batch Sampler, starting in line 49.)
The trainer gets called here:
I know that the code is nested and embedded in luigi, so it might be difficult to read at some points.
If you have any questions, or need more information, I am happy to make my problem easier to understand.
Best regards and thanks in advance,