How to change EvaluationLoop for time dependent data #12606
Unanswered
Udneowi
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I am trying to rewrite some old code I wrote in vanilla PyTorch to PL, but I am having some issues with the fact that I am dealing with time dependent data.
In short the network is predicting the next token in a sequence, where each sequence is independent and of varying lengths. During validation I therefor have to warm up the hidden state for each sequence and then begin predictions. Old pseudo code was something like the following:
However in PyTorch Lightning it is not straight forward to copy this "double loop" with warmup format. I have tried creating my own EvaluationLoop after reading the page on Loops where it seemed simple but with no success. My hacky attempt was the following:
which does "work" in the sense that it computes all the relevant stuff, but it messes to much with the underlying functions and I have no clue where to store the output.
Does anyone have a lead on how to solve this? :)
Any ideas is much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions