fix(cwb): keep preset scale neutral

Runtime conditioning scale reduction must not be carried into persisted model or LoRA weights. Keep named merger presets at 1.0 and reserve scaling for explicit custom configuration.
This commit is contained in:
silveroxides
2026-08-03 18:48:14 +02:00
parent 10484831d0
commit 3bd4977d2a
3 changed files with 14 additions and 7 deletions
+3 -1
View File
@@ -23,7 +23,9 @@ alignment reference.
`baseline` is the default. The standard clarity, smooth, varied, and diversity
presets are joined by `power_blend` and the DSC presets demonstrated by the CWB
conditioning implementation. Select `custom` to make every manual CWB control
authoritative.
authoritative. Every named merger preset keeps `global_scale` at `1.0`; scaling
persisted model or LoRA weights is only performed when explicitly selected in
the custom controls.
Similarity alignment greedily matches source rows to the reference by cosine
similarity. Index alignment keeps absolute row positions. Position weight can
+6 -6
View File
@@ -72,17 +72,17 @@ CWB_PRESETS = {
"varied_merge": {
"consensus_type": "median", "power_alpha": 2.0,
"similarity_threshold": 0.0, "diversity_beta": 0.0,
"rescale_norm": True, "global_scale": 0.7,
"rescale_norm": True, "global_scale": 1.0,
},
"diverse_concept": {
"consensus_type": "median", "power_alpha": 2.0,
"similarity_threshold": 0.0, "diversity_beta": 1.0,
"rescale_norm": True, "global_scale": 0.7,
"rescale_norm": True, "global_scale": 1.0,
},
"high_diversity_concept": {
"consensus_type": "median", "power_alpha": 2.0,
"similarity_threshold": 0.0, "diversity_beta": 2.0,
"rescale_norm": True, "global_scale": 0.7,
"rescale_norm": True, "global_scale": 1.0,
},
"dsc_baseline": {
"consensus_type": "median", "power_alpha": 2.0,
@@ -105,19 +105,19 @@ CWB_PRESETS = {
"dsc_varied_merge": {
"consensus_type": "median", "power_alpha": 2.5,
"similarity_threshold": 0.0, "diversity_beta": 0.0,
"rescale_norm": True, "global_scale": 0.7,
"rescale_norm": True, "global_scale": 1.0,
"dynamic_similarity_contrast": True, "soft_comfort_bandpass": True,
},
"dsc_diverse_concept": {
"consensus_type": "median", "power_alpha": 2.0,
"similarity_threshold": 0.0, "diversity_beta": 1.5,
"rescale_norm": True, "global_scale": 0.7,
"rescale_norm": True, "global_scale": 1.0,
"dynamic_similarity_contrast": True, "soft_comfort_bandpass": True,
},
"dsc_high_diversity_concept": {
"consensus_type": "median", "power_alpha": 2.0,
"similarity_threshold": 0.0, "diversity_beta": 3.0,
"rescale_norm": True, "global_scale": 0.7,
"rescale_norm": True, "global_scale": 1.0,
"dynamic_similarity_contrast": True, "soft_comfort_bandpass": True,
},
}
+5
View File
@@ -69,6 +69,11 @@ def _params(output_filename, **overrides):
def test_preset_resolution_matches_extended_contract(cwb):
assert all(
preset["global_scale"] == pytest.approx(1.0)
for preset in cwb.CWB_PRESETS.values()
)
power = cwb.resolve_cwb_settings(cwb_preset="power_blend")
assert power.consensus_type == "median"
assert power.alignment_threshold == pytest.approx(0.9)