Repository navigation
Conversation
Summary:
# Why
Transfer learning combines parameter definitions from the target and auxiliary experiments. Rebuilding a choice parameter can silently replace its logarithmic or linear scale with a default inferred from the combined values. Preserve the existing scale so that adding source data does not change the model's input transform.
# Changes
- Preserve the first choice parameter's `log_scale` when merging two choice parameters, following the existing attribute precedence rule.
- Preserve the choice parameter's `log_scale` when merging it with a fixed parameter, in either argument order.
- Cover explicit logarithmic and linear scales with values for which automatic inference would choose the opposite scale.
# Examples
Input:
```python
choice = ChoiceParameter(
"x", ParameterType.INT, values=[1, 2],
is_ordered=True, sort_values=True, log_scale=True,
)
fixed = FixedParameter("x", ParameterType.INT, value=3)
merged = merge_parameters(choice, fixed, reverse_param_config={})
```
## Before
```python
merged.values # [1, 2, 3]
merged.log_scale # False: inferred again from the merged values
```
## After
```python
merged.values # [1, 2, 3]
merged.log_scale # True: preserved from the choice parameter
```
Likewise, merging an explicitly linear choice `[1, 2]` with fixed value `4` now preserves `False` instead of inferring `True` from `[1, 2, 4]`.
Differential Revision: D126675426
|
@ltiao has exported this pull request. If you are a Meta employee, you can view the originating Diff in D126675426. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5307 +/- ##
=======================================
Coverage 96.60% 96.60%
=======================================
Files 621 621
Lines 71085 71095 +10
=======================================
+ Hits 68674 68684 +10
Misses 2411 2411 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This pull request has been merged in add8500. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Why
Transfer learning combines parameter definitions from the target and auxiliary experiments. Rebuilding a choice parameter can silently replace its logarithmic or linear scale with a default inferred from the combined values. Preserve the existing scale so that adding source data does not change the model's input transform.
Changes
log_scalewhen merging two choice parameters, following the existing attribute precedence rule.log_scalewhen merging it with a fixed parameter, in either argument order.Examples
Input:
Before
After
Likewise, merging an explicitly linear choice
[1, 2]with fixed value4now preservesFalseinstead of inferringTruefrom[1, 2, 4].Differential Revision: D126675426