test_data: A DataLoader instance representing the testing data
searcher = self._load_searcher()
graph = searcher.load_best_model()
if retrain:
graph.weighted = False
After Change
elif self.verbose:
print("Time is out.")
def final_fit(self, train_data, test_data, trainer_args=None, retrain=False):
Final training after found the best architecture.
Args:
trainer_args: A dictionary containing the parameters of the ModelTrainer constructor.
retrain: A boolean of whether reinitialize the weights of the model.
train_data: A DataLoader instance representing the training data
test_data: A DataLoader instance representing the testing data
graph = self.searcher.load_best_model()
if retrain:
graph.weighted = False
_, _1, graph = train(q=None, args=(graph,
train_data,
test_data,
trainer_args,
self.metric,
self.loss,
self.verbose,
self.path))
self.searcher.replace_model(graph, self.searcher.get_best_model_id())
pickle_to_file(self, os.path.join(self.path, "module"))
@property
def best_model(self):
return self.searcher.load_best_model()