Beispiel #1
0
    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)
Beispiel #2
0
 def initOptimizer(self):
     self.initSgdOptimizer()
     LOG.logW(
         "You should reimplement initOptimizer() to initialize self.optimizer, unless SGD is exactly what you need"
     )
Beispiel #3
0
 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"
     )
Beispiel #4
0
 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"
     )