def build_model(self):
    'Build and register model.\n\n        The default builds a classification model along with its\n        optimizer and scheduler.\n\n        Custom trainers can re-implement this method if necessary.\n        '
    cfg = self.cfg
    print('Building model')
    self.model = SimpleNet(cfg, cfg.MODEL, self.num_classes)
    if cfg.MODEL.INIT_WEIGHTS:
        load_pretrained_weights(self.model, cfg.MODEL.INIT_WEIGHTS)
    self.model.to(self.device)
    print('# params: {:,}'.format(count_num_param(self.model)))
    self.optim = build_optimizer(self.model, cfg.OPTIM)
    self.sched = build_lr_scheduler(self.optim, cfg.OPTIM)
    self.register_model('model', self.model, self.optim, self.sched)
Build and register model.

The default builds a classification model along with its
optimizer and scheduler.

Custom trainers can re-implement this method if necessary.
def build_model(self):
    'Build and register model.\n\n        The default builds a classification model along with its\n        optimizer and scheduler.\n\n        Custom trainers can re-implement this method if necessary.\n        '
    cfg = self.cfg
    print('Building model')
    self.model = SimpleNet(cfg, cfg.MODEL, self.num_classes)
    if cfg.MODEL.INIT_WEIGHTS:
        load_pretrained_weights(self.model, cfg.MODEL.INIT_WEIGHTS)
    self.model.to(self.device)
    print('# params: {:,}'.format(count_num_param(self.model)))
    self.optim = build_optimizer(self.model, cfg.OPTIM)
    self.sched = build_lr_scheduler(self.optim, cfg.OPTIM)
    self.register_model('model', self.model, self.optim, self.sched)