1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-12 23:36:54 +08:00

Add return for use_gpu..

This commit is contained in:
D-X-Y
2021-03-11 19:28:00 -08:00
parent 593553f573
commit 1d435248e2
11 changed files with 31 additions and 28 deletions

View File

@@ -93,7 +93,7 @@ class ALSTM(Model):
"\nearly_stop : {}"
"\noptimizer : {}"
"\nloss_type : {}"
"\nvisible_GPU : {}"
"\ndevice : {}"
"\nuse_GPU : {}"
"\nseed : {}".format(
d_feat,
@@ -107,7 +107,7 @@ class ALSTM(Model):
early_stop,
optimizer.lower(),
loss,
GPU,
self.device,
self.use_gpu,
seed,
)
@@ -138,7 +138,7 @@ class ALSTM(Model):
@property
def use_gpu(self):
self.device != torch.device("cpu")
return self.device != torch.device("cpu")
def mse(self, pred, label):
loss = (pred - label) ** 2