microsoft / microsoft/qlib

TCN model code error

Open
#1,401 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
48.7k
Forks
7.7k
PR merge metrics
No merged PRs in 30d

Description

🐛 Bug Description

qlib/contrib/model/pytorch_tcn_ts.py
line 171-line174
feature = data[:, :, 0:-1].to(self.device)
label = data[:, -1, -1].to(self.device)

        pred = self.TCN_model(feature.float())

To Reproduce

Steps to reproduce the behavior:

  1. change seq len as 10, and run \examples\benchmarks\TCN\workflow_config_tcn_Alpha158.yaml

Expected Behavior

Screenshot

image
x as input with shape(batch,seq_len,feat), but right input should be as shape(batch,feat,seq_len,) so nn.Conv1d can be calculate

Environment

Note: User could run cd scripts && python collect_info.py all under project directory to get system information
and paste them here directly.

  • Qlib version:
  • Python version:
  • OS (Windows, Linux, MacOS):
  • Commit number (optional, please provide it if you are using the dev version):

Additional Notes

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in qlib/contrib/model/pytorch_tcn_ts.py at lines 171–174 and inspect how the TCN receives feature data relative to nn.Conv1d’s expected shape. Reproduce with sequence length 10 using examples/benchmarks/TCN/workflow_config_tcn_Alpha158.yaml. Done means the workflow runs without the reported input-shape error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.