def initOutputDir(self): if self.conf.output_dir != 'output': LOG.logW("According deepvac standard, you should save model files to output directory.") self.output_dir = '{}/{}'.format(self.conf.output_dir, self.branch) LOG.logI('model save dir: {}'.format(self.output_dir)) if not os.path.exists(self.output_dir): os.makedirs(self.output_dir)
def initOptimizer(self): self.initSgdOptimizer() LOG.logW( "You should reimplement initOptimizer() to initialize self.optimizer, unless SGD is exactly what you need" )
def initScheduler(self): self.scheduler = torch.optim.lr_scheduler.StepLR( self.optimizer, self.conf.lr_step, self.conf.lr_factor) LOG.logW( "You should reimplement initScheduler() to initialize self.scheduler, unless lr_scheduler.StepLR() is exactly what you need" )
def initCriterion(self): self.criterion = torch.nn.CrossEntropyLoss() LOG.logW( "You should reimplement initCriterion() to initialize self.criterion, unless CrossEntropyLoss() is exactly what you need" )