def best_vals_to_regrets(f_infos, best_mats):
    """Convert best values found to simple regret.
    Args:
        f_infos: List of Namespaces for functions to look at.
        best_mats: Dict method -> matrix of best values found
            (row corresponds to run).
    Returns: Dictionary mapping method -> transformed matrix.
    """
    max_val = 0
    for f_info in f_infos:
        max_val += f_info.max_val
    to_return = {}
    for method, mat in (best_mats.items()):
        to_return[method] = max_val - mat
    return to_return