mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-03 19:10:58 +08:00
fix tra when logdir is None
This commit is contained in:
@@ -352,7 +352,8 @@ class TRAModel(Model):
|
||||
"model": copy.deepcopy(self.model.state_dict()),
|
||||
"tra": copy.deepcopy(self.tra.state_dict()),
|
||||
}
|
||||
torch.save(best_params, self.logdir + "/model.bin")
|
||||
if self.logdir is not None:
|
||||
torch.save(best_params, self.logdir + "/model.bin")
|
||||
else:
|
||||
stop_rounds += 1
|
||||
if stop_rounds >= self.early_stop:
|
||||
|
||||
Reference in New Issue
Block a user