reset optimizer for multiple runs #7569
Unanswered
aRI0U
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment 2 replies
-
It's not that we reset them manually,
You should be able to modify their state |
Beta Was this translation helpful? Give feedback.
2 replies
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 need to run multiple similar trainings in order to evaluate the average performance of my model, so I need to reset the weights of my network as well as the state of my optimizer, scheduler, etc.
I use the same
LightningModule
for all runs but a newTrainer
for each run. I manually reset the weights of the network between each run so there is no issue here, however I don't know if the optimizers are reset when I pass theLightningModule
to a newTrainer
. If not, does anyone know how to reset them? It seems that I can access the optimizer withself.optimizers().optimizer
but I don't know to what extent I'm able to overwrite it easily.Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions