예제 #1
0
def manual_eval(num_eval):
    with tf.Session(config=tf.ConfigProto(allow_soft_placement=True,
        log_device_placement=FLAGS.log_device_placement)) as sess:
        # Create model and load parameters.
        _, model_sig = graph_utils.get_model_signature(FLAGS)
        _, rev_nl_vocab, _, rev_cm_vocab = data_utils.load_vocab(FLAGS)
        _, dev_set, _ = load_data(use_buckets=False)

        eval_tools.manual_eval(model_sig, dev_set, rev_nl_vocab, FLAGS,
                               FLAGS.model_dir, num_eval)
예제 #2
0
def eval(data_set, model_sig=None, verbose=True):
    with tf.Session(config=tf.ConfigProto(allow_soft_placement=True,
        log_device_placement=FLAGS.log_device_placement)) as sess:
        if model_sig is None:
            _, model_sig = graph_utils.get_model_signature(FLAGS)
        print("evaluate " + model_sig + "...")
        _, rev_nl_vocab, _, rev_cm_vocab = data_utils.load_vocab(FLAGS)

        return eval_tools.eval_set(model_sig, data_set, rev_nl_vocab, FLAGS,
                                   verbose=verbose)