def loadDistConfig(f_cfg):
    """
        Load distance loss related config file (txt)
        format: each line is conposed of argument
            argument value
            ex) distance_loss weighted_l2
                anchorwise_output true
                distance_loss_weight 1.0
        Args:
            f_cfg: Path to the config file

        Returns:
            dist_config: Dictionary of config
    """
    type_dict = {}
    type_dict['distance_loss'] = str
    type_dict['anchorwise_output'] = bool
    type_dict['distance_weight'] = float

    dist_config = {}
    with open(f_cfg,'r') as f_dist:
        for line in f_dist:
            tmp_list = line.split('\n')[0].split(' ')
            assert len(tmp_list)==2, \
                "Wrong format in config file: {}".format(f_dist)
            dist_config[tmp_list[0]] = type_dict[tmp_list[0]](tmp_list[1])

    return dist_config