microsoft / microsoft/qlib

qlib/qlib/contrib/model /pytorch_tcn_ts.py error

Open
#1,752 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

To Reproduce

Steps to reproduce the behavior:

  1. set batch size of model as 2000
  2. set len of infer dataset as 10001
  3. error occur

reason: infer dataset will be split as 5*2000+1, 2000 will be shaped as np.array vector, and 1 will be shaped as np.array scalar.
Calling np.concatenate between vector and scalar will raise error.

Expected Behavior

Screenshot

image

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/qlib/contrib/model/pytorch_tcn_ts.py and reproduce the failure with batch size 2000 and an inference dataset of length 10001. Trace the batching and np.concatenate call; done means inference completes when the final batch contains one item instead of raising a vector-versus-scalar error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.