self.parameters of pl.LightningModule #10813
Unanswered
thistlillo
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 2 comments 5 replies
-
it should be |
Beta Was this translation helpful? Give feedback.
5 replies
-
If I have two nn module classes, one for encoder and one for decoder as in GAN.
See this pytorch lightning GAN tutorial for reference which does not use self.parameters() . will encoder and decoder both be iterated with self.parameters() ? Remember in GAN forward pass is just encoder pass. |
Beta Was this translation helpful? Give feedback.
0 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.
-
Looking at the animation here:
https://www.pytorchlightning.ai/
starting with "1. Computational code goes into LightningModule"
the configure_optimizers(.) method becomes:
(see attached image)
However, if I use
self.parameters
I gen an error:I need to use
self.parameters()
(with the two parentheses), as in other examples I have found. It makes sense, but...... the
self.parameters
(without parantheses) is on the home page, inside of the "official presentation".Which is the correct one? Why do I get that error?
Regards
Beta Was this translation helpful? Give feedback.
All reactions