tufts-ml / covid19-forecasting

Simulation software for forecasting demand at various stages of hospitalization
MIT License
3 stars 0 forks source link

ENH calls to run_forecast.py now execute simulations for multiple seeds #15

Closed michaelchughes closed 4 years ago

michaelchughes commented 4 years ago

New possible syntax for run_forecast.py via keyword arg --num_seeds

run_forecast.py --random_seed X --num_seeds Y

will now run in that one call separate simulations for seed X, seed X+1, ... seed X+Y-1

Default behavior (--num_seeds 1) is same as before.

This makes running lots of seeds much easier.

See additional changes to slurm workflow in workflows/demo_20200410_fast/

$ cd workflows/demo_20200410_fast

# 1) Launch forecasts for 1000 random seeds for each of four possible scenarios
# using separate SLURM jobs for seeds 1000-1099, 1100-1199, 1200-1299, .... 1900-1999
# FYI relies on the following settings in the config.json
#    "min_random_seed": 1000
#   "max_random_seed": 2000,
#    "num_seeds_per_run": 100,
#    "comma_sep_scenarios": "1,2,3,4",
$ snakemake --profile ../../profiles/hugheslab_cluster/ many_simulations_following_template

# 2) Summarize all 1000 runs of each scenario
$ snakemake --cores 1 summarize_all

# 3) Make static HTML plots of each scenario
$ snakemake --cores 1 plot_all