def predict(conf_dict):
    """
    predict
    """
    net = utility.import_object(
        conf_dict["net_py"], conf_dict["net_class"])(conf_dict)
    conf_dict.update({"num_epochs": "1", "batch_size": "1",
                      "shuffle": "0", "train_file": conf_dict["test_file"]})
    test_datafeed = datafeeds.TFPointwisePaddingData(conf_dict)
    test_l, test_r, test_y = test_datafeed.ops()
    # test network
    pred = net.predict(test_l, test_r)
    controler.run_predict(pred, test_y, conf_dict)
Beispiel #2
0
def predict(conf_dict):
    tf.compat.v1.reset_default_graph()
    net = utility.import_object(conf_dict["net_py"],
                                conf_dict["net_class"])(conf_dict)
    conf_dict.update({
        "batch_size": "1",
        "shuffle": "0",
        "train_file": conf_dict["test_file"]
    })
    if "dropout_rate" in conf_dict:
        conf_dict.update({"dropout_rate": 1.0})
    test_datafeed = datafeeds.TFPointwisePaddingData(conf_dict)
    test_l, test_r, test_y = test_datafeed.ops()
    pred = net.predict(test_l, test_r)
    controler.run_predict(pred, test_y, conf_dict)