Shared calibration machinery for local areas: L2 anchor, target-weight rule, loss cap for each target and one area support gate
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 12/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- data, machine-learning
Línea de trabajo
This is a multi-part design refactor touching microcosm.calibrate, microcosm.build.gates.area_support_gate, uk_runtime/local_doctrine.py, us_runtime/target_loss_weights.py, and the tools tools/us_acs_local_cd_surface.py and tools/build_us_acs_local_release.py. Start by reading the shared solver's l2_anchor options and the two target-weight rules side by side. Done means the US local build with default declarations produces identical weights, and the US tools hold no duplicate ESS or gate code.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Why
The UK local build uses solver options that the US local build does not use. Most of them are already in the shared solver (microcosm.calibrate). The rest is country code on both sides.
This issue moves each piece to shared code, with the country's choice as data. No item changes an output until a build turns it on. No item adds a check that can block a release.
Where each piece is today
| Piece | Shared code | UK local build | US local build |
|---|---|---|---|
| L2 penalty, chi-square basis | Yes, since #1078 | On (refit stage) | Flags exist (--l2-lambda, --l2-basis). Default λ is 0 |
| L2 anchor | Yes: l2_anchor and l2_anchor_weights in calibrate |
uniform |
Not exposed. Always initial |
| Target-weight rule across levels and families | No | nation_grain_family_equal_sqrt_count in uk_runtime/local_doctrine.py |
us_runtime/target_loss_weights.py: weights by value and concept. No balance across levels |
| Loss cap | One number for the run | One number | One number. The county profile changes it for the whole joint run |
| Area support gate | microcosm.build.gates.area_support_gate (rows, ESS, distinct sources) |
Used | Own gate in the tool (district_ess_collapse_gate), plus two copies of the ESS code |
| Weight bound | max_weight_ratio, relative to each row's own starting weight |
Used | Used. A donor row starts about 27 times heavier than an ACS row, so its bound is 27 times higher |
Work
- Expose the L2 anchor in the US local tool.
- Add
--l2-anchorand an option for anchor weights. - With the
initialanchor, the penalty pulls toward the starting weights, so ESS cannot pass their ESS. - Anchor weights let the penalty pull toward a declared design, without a change to the starting weights.
- Add
- Move the target-weight rule to shared code.
- Today the UK rule reads a UK-only row carrier. The US function already takes plain row arrays.
- Write one shared rule that takes the level, family, basis and value of each target.
- Each country declares the rule name and its parameters.
- On the September surface, state SOI rows hold 90.2% of the US loss weight.
- Allow a loss cap for each target or family.
- Today the county profile sets the cap to 10 and the weight ratio to 5 for the whole joint run.
- A vector of caps keeps the state and district caps as they are when county rows join the solve.
- Use one area support gate.
- Add an optional floor that is relative to the starting ESS (the rule #1078 adopted) to the shared gate.
- The US local build reads the shared gate. Delete
ess_by_groupintools/us_acs_local_cd_surface.pyand the inline copy intools/build_us_acs_local_release.py. - The gate stays report-only. Whether it blocks a release is a decision in the epic.
- State one contract for the weight bound (#493). Consider a bound relative to a declared reference weight, so that a heavy starting row does not get a larger bound.
- Add a diagnostic for each spine and target.
- For each target, report the share of its total that each spine carries, against that spine's share of the mass.
- A target that donor rows carry almost alone pulls weight to them. This ranks the #1720 items by their effect on ESS.
- #578 lists spine agreement in its battery. The diagnostic is shared and works for any pooled build.
Parked
- An entropy (KL) objective and tolerances for each target: #458.
- The λ sweep on the national sparse file: #285.
Done when
- Items 1 to 4 and 6 are in shared code with tests, and each country's choice is a declaration.
- A US local build with the default declarations gives the same weights as before.
- The US tools hold no copy of the ESS or gate code.
Related
#1078, #1104, #1163, #1124, #1585, #611, #493, #458, #578.
- Lenguaje dominante
- Python
- Estrellas
- 0
- Forks
- 6
- Merge medio
- 1 d 17 h
- PR fusionados (30 d)
- 190
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PolicyEngine/microcosm
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
PolicyEngine/microcosm#1766 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
PolicyEngine/microcosm#1721 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
PolicyEngine/microcosm#1701 ·
Los mantenedores suelen responder en 1 día
-
County rung: a malformed-geography refusal leaves an old county_surface.json success receiptAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
PolicyEngine/microcosm#1638 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
PolicyEngine/microcosm#1431 ·
Los mantenedores suelen responder en 1 día
Todos los issues de PolicyEngine/microcosm
Issues similares
-
claude-subscription-directsdk: tool calls with raw control characters in string values are droppedAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
NousResearch/hermes-official-plugins#538 ·
Los mantenedores suelen responder en 3 días
-
bug(qdiffusion): EnergyModel.score_visible_logits computes biased visible/hidden on-ratios when solver returns variable solution counts per candidatePosiblemente ocupada @houzhongyu la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
qboson/kaiwu-pytorch-plugin#2133 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
MakazhanAlpamys/Soup#3415 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días