in hucc/agents/hsd3.py [0:0]
def parse_lo_info(cfg):
p = Path(cfg.lo.init_from)
abs_path = str(p.with_name(p.stem + '_abs.json'))
log.debug(f'Loading subset information from checkpoint {abs_path}')
with open(abs_path, 'rt') as ft:
d = json.load(ft)
if 'task_map' in d:
task_map = d['task_map']
cperf = d['cperf']
if 'total' in cperf:
del cperf['total']
eps = cfg.goal_space.from_lo_eps
subsets = sorted_nicely_sep(
list(set([k for k, v in cperf.items() if v >= 1.0 - eps]))
)
if cfg.goal_space.rank_min > 0:
subsets = [
a
for a in subsets
if len(a.split(',')) >= cfg.goal_space.rank_min
]
if cfg.goal_space.rank_max > 0:
subsets = [
a
for a in subsets
if len(a.split(',')) <= cfg.goal_space.rank_max
]
return subsets, task_map