I’m looking for general best practices when constructing something like a VAE which uses pre-defined Encoders and Decoders. For example, this may look something like this:
class MyEncoder(nn.Module):
def __init__(self, ...):
...
class MyDecoder(nn.Module):
def __init__(self, ...):
...
class VAE(pl.LightningModule):
def __init__(self, ...):
self.encoder = MyEncoder()
self.decoder = MyDecoder()
Is it generally best practice for the classes MyEncoder
and MyDecoder
to inherit from nn.Module, or should they also inherit from pl.LightningModule
?