def setup(self, config): model = PTL_Module(config) opt = optimizer_creator(model, config) scheduler = scheduler_creator(opt, config) self.model, self.optimizer, self.criterion, self.scheduler = \ self.register( models=model, optimizers=opt, criterion=nn.MSELoss(), schedulers=scheduler) train_loader, val_loader = data_creator(config) self.register_data(train_loader=train_loader, validation_loader=val_loader)
def configure_optimizers(self): optimizer = optimizer_creator(self, self.config) scheduler = scheduler_creator(optimizer, self.config) return [optimizer], [scheduler]