mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-12 15:26:54 +08:00
Fix TCN model input dimension mismatch (#1520)
* transpose dimension 1 and 2 to match nn.Conv1d input * 1.update TCN benchmarks; 2.Emphasize updating the benchmark table; * replace specific version with main --------- Co-authored-by: lijinhui <362237642@qq.com>
This commit is contained in:
@@ -168,7 +168,8 @@ class TCN(Model):
|
||||
self.TCN_model.train()
|
||||
|
||||
for data in data_loader:
|
||||
feature = data[:, :, 0:-1].to(self.device)
|
||||
data = torch.transpose(data, 1, 2)
|
||||
feature = data[:, 0:-1, :].to(self.device)
|
||||
label = data[:, -1, -1].to(self.device)
|
||||
|
||||
pred = self.TCN_model(feature.float())
|
||||
@@ -187,8 +188,8 @@ class TCN(Model):
|
||||
losses = []
|
||||
|
||||
for data in data_loader:
|
||||
|
||||
feature = data[:, :, 0:-1].to(self.device)
|
||||
data = torch.transpose(data, 1, 2)
|
||||
feature = data[:, 0:-1, :].to(self.device)
|
||||
# feature[torch.isnan(feature)] = 0
|
||||
label = data[:, -1, -1].to(self.device)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user