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

update run_all_model and black format

This commit is contained in:
Young
2021-07-18 12:09:57 +08:00
committed by you-n-g
parent b07e0bffb1
commit 59d4bc9394
4 changed files with 41 additions and 14 deletions

View File

@@ -23,6 +23,7 @@ from .pytorch_utils import count_parameters
from ...model.base import Model
from ...data.dataset import DatasetH, TSDatasetH
from ...data.dataset.handler import DataHandlerLP
# qrun examples/benchmarks/Transformer/workflow_config_transformer_Alpha360.yaml ”
@@ -149,8 +150,8 @@ class TransformerModel(Model):
if len(indices) - i < self.batch_size:
break
feature = torch.from_numpy(x_values[indices[i: i + self.batch_size]]).float().to(self.device)
label = torch.from_numpy(y_values[indices[i: i + self.batch_size]]).float().to(self.device)
feature = torch.from_numpy(x_values[indices[i : i + self.batch_size]]).float().to(self.device)
label = torch.from_numpy(y_values[indices[i : i + self.batch_size]]).float().to(self.device)
with torch.no_grad():
pred = self.model(feature)