in torchrecipes/audio/source_separation/train_app.py [0:0]
def get_lightning_module(self) -> LightningModule:
"""
Instantiate a LightningModule.
"""
module = ConvTasNetModule(
self.module_conf.model,
self.module_conf.loss,
self.module_conf.optim,
self.module_conf.metrics,
self.module_conf.lr_scheduler,
)
if self.pretrained_checkpoint_path:
return ConvTasNetModule.load_from_checkpoint(
checkpoint_path=none_throws(self.pretrained_checkpoint_path),
strict=self.load_checkpoint_strict,
model=module.model,
loss=module.loss,
optim=module.optim,
metrics=module.metrics,
lr_scheduler=module.lr_scheduler,
)
return module