Optimizers for nested modules #8637
-
class MyNet(pl.LightningModule):
def __init__(self):
self.m1 = MyMod1()
self.m2 = MyMod2() If I implement different |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
When you have nested LightningModules, their That being said, if you call, merge and return the optimizers created there, these optimizers should only contain parameters from the respective submodule (if implemented correctly) |
Beta Was this translation helpful? Give feedback.
When you have nested LightningModules, their
configure_optimizers
will never be called unless you explicitly call it in the top-levelconfigure_optimizers
.That being said, if you call, merge and return the optimizers created there, these optimizers should only contain parameters from the respective submodule (if implemented correctly)