How to have model defined in another file? #6371
Unanswered
stanleyshly
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.
-
In the github: it says to define the class like this
def init(self):
super().init()
self.encoder = nn.Sequential(nn.Linear(28 * 28, 128), nn.ReLU(), nn.Linear(128, 3))
self.decoder = nn.Sequential(nn.Linear(3, 128), nn.ReLU(), nn.Linear(128, 28 * 28))
, but is there anyway to import a model from another file like output=model(input), and use that in the class definition?
Beta Was this translation helpful? Give feedback.
All reactions