HIST model missing explicit pretrain toggle in initialization
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 48.7k
- Forks
- 7.7k
- PR merge metrics
- No merged PRs in 30d
Description
In contrib\model\pytorch_hist.py
Description: Currently, the HIST model implementation in qlib lacks an explicit parameter to control the pre-training loading logic. This makes it difficult for users to skip the pre-training weight-loading phase even when a model path is specified or when they wish to train the architecture from scratch.
Proposed Changes:
init method: Added pretrain (defaulting to True for backward compatibility) to the parameters.
Logic Update: Wrapped the weight-loading and state_dict update logic inside if self.pretrain:.
# In __init__
def __init__(self, ..., pretrain=True, **kwargs):
...
self.pretrain = pretrain
# In weight loading logic
if self.pretrain:
if self.model_path is not None:
self.logger.info("Loading pretrained model...")
pretrained_model.load_state_dict(torch.load(self.model_path))
# ... (state_dict update logic)
self.logger.info("Loading pretrained model Done...")
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in contrib/model/pytorch_hist.py by reading the init method and the existing pretrained weight-loading and state_dict update logic. Confirm the pretrain option defaults to true for backward compatibility, skips that loading path when false, and preserves loading behavior when enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100