- Make a python module (which can be a single python script
your_experiment.pyin the same format asexperiment_script.py). It must export two functions:make_df(): pd.DataFrame, andexperiment(row:pd.Series):Dict.make_dfreturns a DataFrame which has each row corresponding to an experiment that should be run. The columns correspond to different hyperparameters specified for a particular experiment. Any elements in theattrsof the dataframe will be preserved when running the experiments.experiment(row):Dicttakes as an argument a single row of the dataframe returned bymake_df(). It should perform the experiment, and then return a dict with labelled results of the experiment. Each key in the dict will correspond to a new column in the resulting dataframe.
- Clone this repository in a directory like the
scratchdirectory on the server. - Modify the running parameters within
run_experiments.sh, including the "BASE_OUT_DIR" variable defined lower. - In a shell on the server, from the root of the cloned repository, run the command
./run_experiments.sh <PATH_TO_EXPERIMENT_MODULE> <PATH_TO_OUTPUT_DIR> ./parallelize_on_slurm.py The script produces an output DataFrame which is the DataFrame created by make_df() with additional rows containing the results of the experiments. This output will be written to the file $OUTPUT_DIR/$JOB_NAME/combined_results.pickle, with the bash variables as specified in run_experiments.sh. For quick checks of the results, a printout of the resulting DataFrame is available in $OUTPUT_DIR/$JOB_NAME/cleanup_stdout. Other information about individual tasks will be logged in the same directory.
Add a check before the start of the run, that the dataframe has all required keys.