geoprior.cli.run_sensitivity#

run_sensitivity.py

Driver to run a (lambda_cons, lambda_prior) sensitivity grid for GeoPriorSubsNet using the existing Stage-2 training script.

This script calls sensitivity.py multiple times with environment overrides. Each run should write its own ablation record (entry in ablation_records/ablation_record.jsonl), which your make_supp_figS6_ablations.py later aggregates.

Core overrides (expected by sensitivity.py)#

  • EPOCHS_OVERRIDE

  • PDE_MODE_OVERRIDE

  • LAMBDA_CONS_OVERRIDE

  • LAMBDA_PRIOR_OVERRIDE

Optional “deconfounding” overrides (safe to export even if sensivity.py ignores some of them; you can wire them later) ———————————————————– - TRAINING_STRATEGY_OVERRIDE - Q_POLICY_OVERRIDE - SUBS_RESID_POLICY_OVERRIDE - ALLOW_SUBS_RESIDUAL_OVERRIDE - LAMBDA_Q_OVERRIDE - PHYSICS_WARMUP_STEPS_OVERRIDE - PHYSICS_RAMP_STEPS_OVERRIDE - LAMBDA_GW_OVERRIDE - LAMBDA_SMOOTH_OVERRIDE - LAMBDA_BOUNDS_OVERRIDE - LAMBDA_MV_OVERRIDE

Driver to run a (lambda_cons, lambda_prior) sensitivity grid for GeoPriorSubsNet using the Stage-2 sensitivity script.

Resume mechanism#

On restart, the script scans existing ablation_record.jsonl files under the results directory and skips runs that already finished.

A run is considered “done” if an ablation record exists containing pde_mode, lambda_cons, and lambda_prior (and matching CITY when available).

Usage#

set CITY=zhongshan python nat.com/run_lambda_sensitivity.py –epochs 20

to force rerun everything:

python nat.com/run_sensitivity.py –epochs 20 –no-resume

results live elsewhere:

python nat.com/run_sensitivity.py –epochs 20 –scan-root F:/repositories/geoprior-learn/results/zhongshan

python nat.com/run_sensitivity.py –epochs 20 –inprocess –fast

python nat.com/run_sensitivity.py –epochs 20 –gold –eval-max-batches 50 –fast

python nat.com/run_sensitivity.py –epochs 10 –fast –n-jobs -1

python nat.com/run_sensitivity.py –gold –epochs 10 –fast –threads 20

Functions

apply_runner_slicing(runs, *, start, limit)

build_grid(pde_modes, lcons, lprior)

main([argv])

make_env(base_env, *, epochs, spec, ...)

maybe_shuffle(runs, *, shuffle, seed)

parse_args([argv])

run_one_script(train_script, *, env, ...)

sensitivity_main([argv])

Classes

RunSpec(pde_mode, lambda_cons, lambda_prior)

class geoprior.cli.run_sensitivity.RunSpec(pde_mode: 'str', lambda_cons: 'float', lambda_prior: 'float')[source]#

Bases: object

Parameters:
pde_mode: str#
lambda_cons: float#
lambda_prior: float#
key()[source]#
Return type:

str

tag()[source]#
Return type:

str

run_tag()[source]#
Return type:

str

__init__(pde_mode, lambda_cons, lambda_prior)#
Parameters:
Return type:

None

geoprior.cli.run_sensitivity.parse_args(argv=None)[source]#
Parameters:

argv (list[str] | None)

Return type:

Namespace

geoprior.cli.run_sensitivity.build_grid(pde_modes, lcons, lprior)[source]#
Parameters:
Return type:

list[RunSpec]

geoprior.cli.run_sensitivity.maybe_shuffle(runs, *, shuffle, seed)[source]#
Parameters:
Return type:

list[RunSpec]

geoprior.cli.run_sensitivity.apply_runner_slicing(runs, *, start, limit)[source]#
Parameters:
Return type:

list[RunSpec]

geoprior.cli.run_sensitivity.make_env(base_env, *, epochs, spec, strategy, disable_q, disable_subs_resid, no_physics_ramp, physics_warmup_steps, physics_ramp_steps, lambda_gw, lambda_smooth, lambda_bounds, lambda_mv, lambda_q, no_early_stopping, fast, eval_max_batches, batch_size)[source]#
Parameters:
  • base_env (dict[str, str])

  • epochs (int)

  • spec (RunSpec)

  • strategy (str)

  • disable_q (bool)

  • disable_subs_resid (bool)

  • no_physics_ramp (bool)

  • physics_warmup_steps (int | None)

  • physics_ramp_steps (int | None)

  • lambda_gw (float | None)

  • lambda_smooth (float | None)

  • lambda_bounds (float | None)

  • lambda_mv (float | None)

  • lambda_q (float | None)

  • no_early_stopping (bool)

  • fast (bool)

  • eval_max_batches (int | None)

  • batch_size (int | None)

Return type:

dict[str, str]

geoprior.cli.run_sensitivity.run_one_script(train_script, *, env, dry_run, inprocess)[source]#
Parameters:
Return type:

None

geoprior.cli.run_sensitivity.sensitivity_main(argv=None)[source]#
Parameters:

argv (list[str] | None)

Return type:

None

geoprior.cli.run_sensitivity.main(argv=None)[source]#
Parameters:

argv (list[str] | None)

Return type:

None