@@ -162,6 +162,7 @@ def _calibration_package_parameters(
162162 workers : int ,
163163 n_clones : int ,
164164 target_config : str | None ,
165+ target_policy : str | None ,
165166 skip_county : bool ,
166167 chunked_matrix : bool ,
167168 chunk_size : int ,
@@ -174,6 +175,7 @@ def _calibration_package_parameters(
174175 "workers" : workers if not chunked_matrix else None ,
175176 "n_clones" : n_clones ,
176177 "target_config" : target_config ,
178+ "target_policy" : target_policy ,
177179 "skip_county" : skip_county ,
178180 "chunked_matrix" : bool (chunked_matrix ),
179181 "chunk_size" : chunk_size if chunked_matrix else None ,
@@ -281,6 +283,8 @@ def archive_diagnostics(
281283 "log" : f"{ prefix } unified_diagnostics.csv" ,
282284 "cal_log" : f"{ prefix } calibration_log.csv" ,
283285 "config" : f"{ prefix } unified_run_config.json" ,
286+ "target_policy" : f"{ prefix } calibration_target_policy.jsonl" ,
287+ "target_policy_summary" : (f"{ prefix } calibration_target_policy_summary.json" ),
284288 }
285289
286290 for key , filename in file_map .items ():
@@ -1242,6 +1246,7 @@ def run_pipeline(
12421246 workers = num_workers ,
12431247 n_clones = n_clones ,
12441248 target_config = None ,
1249+ target_policy = "policyengine_us_data/calibration/target_policy.yaml" ,
12451250 skip_county = True ,
12461251 chunked_matrix = chunked_matrix ,
12471252 chunk_size = chunk_size ,
@@ -1302,7 +1307,12 @@ def run_pipeline(
13021307 completed_package_manifest = _complete_step_manifest (
13031308 active_step_manifest ,
13041309 outputs = collect_artifacts (
1305- [_artifacts_dir (run_id ) / "calibration_package.pkl" ],
1310+ [
1311+ _artifacts_dir (run_id ) / "calibration_package.pkl" ,
1312+ _artifacts_dir (run_id ) / "calibration_target_policy.jsonl" ,
1313+ _artifacts_dir (run_id )
1314+ / "calibration_target_policy_summary.json" ,
1315+ ],
13061316 missing_ok = True ,
13071317 ),
13081318 vol = pipeline_volume ,
@@ -1321,19 +1331,23 @@ def run_pipeline(
13211331 "gpu" : gpu ,
13221332 "epochs" : epochs ,
13231333 "target_config" : "policyengine_us_data/calibration/target_config.yaml" ,
1334+ "target_policy" : "policyengine_us_data/calibration/target_policy.yaml" ,
13241335 "beta" : 0.65 ,
13251336 "lambda_l0" : 1e-7 ,
13261337 "lambda_l2" : 1e-8 ,
13271338 "log_freq" : 100 ,
1339+ "loss_type" : "relative_epsilon" ,
13281340 }
13291341 national_fit_parameters = {
13301342 "gpu" : national_gpu ,
13311343 "epochs" : national_epochs ,
13321344 "target_config" : "policyengine_us_data/calibration/target_config.yaml" ,
1345+ "target_policy" : "policyengine_us_data/calibration/target_policy.yaml" ,
13331346 "beta" : 0.65 ,
13341347 "lambda_l0" : NATIONAL_FIT_LAMBDA_L0 ,
13351348 "lambda_l2" : 1e-12 ,
13361349 "log_freq" : 100 ,
1350+ "loss_type" : "relative_epsilon" ,
13371351 "skip_national" : skip_national ,
13381352 }
13391353 regional_fit_reuse = _step_reusable (
0 commit comments