Skip to content

Support empty mixture weights (default to lengths)#149

Merged
shuheng-liu merged 2 commits into
mainfrom
feat/empty-mixture-weights
Mar 26, 2026
Merged

Support empty mixture weights (default to lengths)#149
shuheng-liu merged 2 commits into
mainfrom
feat/empty-mixture-weights

Conversation

@shuheng-liu
Copy link
Copy Markdown
Member

What this does

Support empty mixture weights (default to lengths)

How it was tested

Ran tests without specifying mixture weights.

How to checkout & try? (for the reviewer)

Run tests without specifying mixture weights.

Checklist

  • I have added Google-style docstrings to important functions and ensured function parameters are typed.
  • My PR includes policy-related changes.
    • If the above is checked: I have run the GPU pytests (pytest -m "gpu") and regression tests.

Copilot AI review requested due to automatic review settings March 23, 2026 19:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for omitting dataset mixture weights by inferring defaults from dataset lengths, allowing configs to leave weights unset while still producing a valid WeightedDatasetMixture.

Changes:

  • Make DatasetMixtureConfig.weights optional (None means infer at runtime).
  • Infer train/val mixture weights from float(len(dataset)) when weights are None.
  • Document the new optional-weights behavior and add a config-level test for weights=None.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/configs/test_default.py Adds a test ensuring DatasetMixtureConfig accepts weights=None.
src/opentau/datasets/factory.py Infers mixture weights from dataset lengths when weights is None (train and val).
src/opentau/configs/default.py Updates config typing/docs and relaxes validation to allow weights=None.
docs/source/tutorials/datasets.rst Documents that weights can be omitted/null and will be inferred from lengths.
docs/source/concepts.rst Notes default-to-lengths behavior when weights are omitted/null.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/opentau/configs/default.py
Comment thread src/opentau/datasets/factory.py Outdated
WilliamYue37
WilliamYue37 previously approved these changes Mar 23, 2026
@shuheng-liu shuheng-liu merged commit 3cce8a5 into main Mar 26, 2026
5 checks passed
@shuheng-liu shuheng-liu deleted the feat/empty-mixture-weights branch March 26, 2026 04:46
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.

3 participants