Skip to content

fix(model): add pretrain toggle to HIST model#2170

Open
warren618 wants to merge 1 commit intomicrosoft:mainfrom
warren618:fix/hist-pretrain-toggle
Open

fix(model): add pretrain toggle to HIST model#2170
warren618 wants to merge 1 commit intomicrosoft:mainfrom
warren618:fix/hist-pretrain-toggle

Conversation

@warren618
Copy link
Copy Markdown

Summary

Fixes #2074

Added a pretrain parameter (default True for backward compatibility) to HIST model. When pretrain=False, the model trains from scratch without loading pretrained base_model weights.

Changes

  • qlib/contrib/model/pytorch_hist.py:
    • Add pretrain=True parameter to __init__
    • Wrap weight-loading logic in if self.pretrain:

Usage

# Default: loads pretrained weights (backward compatible)
model = HISTModel(model_path="path/to/weights")

# Train from scratch
model = HISTModel(pretrain=False)

Added a pretrain parameter (default True for backward compatibility)
to control whether pretrained base_model weights are loaded during
fit(). When pretrain=False, the model trains from scratch.

Fixes microsoft#2074
@warren618
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HIST model missing explicit pretrain toggle in initialization

1 participant