1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-14 00:06:58 +08:00

Fix and update run_all_model

This commit is contained in:
Jactus
2020-12-01 11:54:26 +08:00
parent bb5f3cb33d
commit 77884db3a5
12 changed files with 42 additions and 26 deletions

View File

@@ -61,7 +61,7 @@ class DNNModelPytorch(Model):
optimizer="gd",
loss="mse",
GPU="0",
seed=0,
seed=None,
**kwargs
):
# Set logger.
@@ -116,8 +116,9 @@ class DNNModelPytorch(Model):
)
)
np.random.seed(self.seed)
torch.manual_seed(self.seed)
if self.seed is not None:
np.random.seed(self.seed)
torch.manual_seed(self.seed)
if loss not in {"mse", "binary"}:
raise NotImplementedError("loss {} is not supported!".format(loss))