예제 #1
0
 def _create_model(self):
     config = self.config
     self.model = create_model(config)
     self.model = self.model.to(get_default_device())
     self.optimizer = optim.Adam(self.model.parameters(),
                                 lr=self.config.train.learning_rate,
                                 weight_decay=self.config.train.l2_reg)
     self.gradient_clip = config.train.gradient_clip
예제 #2
0
 def _create_model(self):
     config = self.config
     self.model = create_model(config)
     self.model = try_gpu(self.model)
예제 #3
0
 def _create_model(self):
     config = self.config
     self.model = create_model(config)
     self.model = self.model.to(get_default_device())