def get_xticks(dir, trainer_ids):
    mapping = {}
    for trainer_id in trainer_ids:
        if (trainer_id in mapping.keys()):
            continue
        config_path = ((dir / trainer_id) / 'config.yml')
        with open(config_path) as f:
            config = yaml.safe_load(f)
        ds_config = config['dataset_config']
        nw_config = config['network_config']
        dd = (ds_config['depth_difference_threshold'] if ('depth_difference_threshold' in ds_config) else 0)
        s = ds_config['scale_images']
        ic = nw_config['initial_channels']
        lr = nw_config['learning_rate']
        lt = nw_config['loss_type']
        o = (nw_config['output_activation'] if ('output_activation' in nw_config) else 'none')
        sk = (int(nw_config['skip_connections']) if ('skip_connections' in nw_config) else 0)
        if (lt == 'huber_loss'):
            lt = 'h'
        elif (lt == 'mean_l1_loss'):
            lt = 'l1'
        elif (lt == 'mean_l2_loss'):
            lt = 'l2'
        if (o == 'none'):
            o = 'n'
        elif (o == 'relu'):
            o = 'r'
        base_title = f'dd{dd}_s{s}_ic{ic}_lr{lr}_l{lt}_o{o}_sk{sk}'
        num_titles = [v.startswith(base_title) for v in mapping.values()].count(True)
        title = (base_title + f'_{num_titles}')
        mapping[trainer_id] = title
    return mapping
def get_xticks(dir, trainer_ids):
    mapping = {}
    for trainer_id in trainer_ids:
        if (trainer_id in mapping.keys()):
            continue
        config_path = ((dir / trainer_id) / 'config.yml')
        with open(config_path) as f:
            config = yaml.safe_load(f)
        ds_config = config['dataset_config']
        nw_config = config['network_config']
        dd = (ds_config['depth_difference_threshold'] if ('depth_difference_threshold' in ds_config) else 0)
        s = ds_config['scale_images']
        ic = nw_config['initial_channels']
        lr = nw_config['learning_rate']
        lt = nw_config['loss_type']
        o = (nw_config['output_activation'] if ('output_activation' in nw_config) else 'none')
        sk = (int(nw_config['skip_connections']) if ('skip_connections' in nw_config) else 0)
        if (lt == 'huber_loss'):
            lt = 'h'
        elif (lt == 'mean_l1_loss'):
            lt = 'l1'
        elif (lt == 'mean_l2_loss'):
            lt = 'l2'
        if (o == 'none'):
            o = 'n'
        elif (o == 'relu'):
            o = 'r'
        base_title = f'dd{dd}_s{s}_ic{ic}_lr{lr}_l{lt}_o{o}_sk{sk}'
        num_titles = [v.startswith(base_title) for v in mapping.values()].count(True)
        title = (base_title + f'_{num_titles}')
        mapping[trainer_id] = title
    return mapping