1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-15 08:46:56 +08:00

Fix models.

This commit is contained in:
lwwang1995
2020-12-06 22:43:52 +08:00
committed by you-n-g
parent 412c9eee2e
commit 8d42092a7e
9 changed files with 45 additions and 48 deletions

Binary file not shown.

View File

@@ -56,7 +56,7 @@ task:
hidden_size: 64 hidden_size: 64
num_layers: 2 num_layers: 2
dropout: 0.0 dropout: 0.0
n_epochs: 2 n_epochs: 200
lr: 1e-3 lr: 1e-3
early_stop: 10 early_stop: 10
batch_size: 800 batch_size: 800

Binary file not shown.

View File

@@ -251,8 +251,7 @@ class GRU(Model):
self.logger.info("best score: %.6lf @ %d" % (best_score, best_epoch)) self.logger.info("best score: %.6lf @ %d" % (best_score, best_epoch))
self.GRU_model.load_state_dict(best_param) self.GRU_model.load_state_dict(best_param)
# torch.save(best_param, save_path) torch.save(best_param, save_path)
torch.save(best_param, '/home/lewwang/qlib/examples/benchmarks/GRU/csi300_gru_ts.pkl')
if self.use_gpu: if self.use_gpu:
torch.cuda.empty_cache() torch.cuda.empty_cache()

View File

@@ -251,9 +251,7 @@ class LSTM(Model):
self.logger.info("best score: %.6lf @ %d" % (best_score, best_epoch)) self.logger.info("best score: %.6lf @ %d" % (best_score, best_epoch))
self.LSTM_model.load_state_dict(best_param) self.LSTM_model.load_state_dict(best_param)
# torch.save(best_param, save_path) torch.save(best_param, save_path)
torch.save(best_param, '/home/lewwang/qlib/examples/benchmarks/LSTM/csi300_lstm_ts.pkl')
if self.use_gpu: if self.use_gpu:
torch.cuda.empty_cache() torch.cuda.empty_cache()