imitation.util.sacred_file_parsing#
Utilities to parse sacred run directories.
Functions
|
Recursively iterates the sacred runs found below the given path. |
|
Groups the runs found below the given path by algorithm and environment. |
- imitation.util.sacred_file_parsing.find_sacred_runs(run_path, only_completed_runs=False)[source]#
Recursively iterates the sacred runs found below the given path.
Assumes runs in the format of the sacred FileStorageObserver: each run consists of a folder that contains a config.json and a run.json file.
Note: will work with nested directories and can therefore be applied to the output/sacred folder of the command line interface which creates sub-folders for each script.
- Parameters
run_path (
Path
) – The path to search for sacred run directories.only_completed_runs (
bool
) – If True, only yields runs that have a run.json file with status “COMPLETED”.
- Yields
Tuples of (config, run) dicts.
- Return type
Generator
[Tuple
[Dict
[str
,Any
],Dict
[str
,Any
]],None
,None
]
- imitation.util.sacred_file_parsing.group_runs_by_algo_and_env(path, only_completed_runs=False)[source]#
Groups the runs found below the given path by algorithm and environment.
Access all the runs of algorithm algo and environment env via runs_by_algo_and_env[algo][env].
- Parameters
path (
Path
) – The path to search for sacred run directories.only_completed_runs (
bool
) – If True, only yields runs that have a run.json file with status “COMPLETED”.
- Return type
Dict
[str
,Dict
[str
,List
[Dict
[str
,Any
]]]]- Returns
A dictionary mapping algorithms to environments to lists of runs.