def build_eval_metrics(model_configs, dataset, is_cheif=True, model_name=None):
    """ Builds training hooks to evaluate model performance.

    Args:
        model_configs: A dictionary of all configurations.
        dataset: A `Dataset` object.
        is_chief: Whether this is the chief process. Only chief process saves
          summaries.
        model_name: A string, the top scope name of all variables.

    Returns: A list of `tf.train.SessionRunHook` objects.
    """
    metrics = []
    if "metrics" in model_configs and isinstance(model_configs["metrics"], list):
        for metric in model_configs["metrics"]:
            metrics.append(eval(metric["class"])(
                model_configs, dataset,
                do_summary=is_cheif,
                model_name=model_name,
                **metric["params"]))
    return metrics