Exemple #1
0
 def _init_data(self):
     self.train = _get_data(Config.train_save_file)
     self.valid = _get_data(Config.valid_save_file)
     self.test = _get_data(Config.test_save_file)
Exemple #2
0
    # init = tf.global_variables_initializer()
    # sess.run(init)

    graph = tf.get_default_graph()
    ph, train_phase = _init_placeholder(graph)
    print(ph)

    prediction = tf.get_collection('pred_network')[0]
    # loss = tf.get_collection('loss')[0]
    loss = graph.get_tensor_by_name('loss:0')

    total_emb, single_size, numerical_size, multi_size = _get_conf()
    field_size = single_size + numerical_size + multi_size
    embedding_length = field_size * Config.embedding_size

    test = _get_data(Config.test_save_file)
    test = test[:30000]
    test_batch = _get_batch(test,
                            -1,
                            single_size=single_size,
                            numerical_size=numerical_size,
                            multi_size=multi_size)
    test_label = get_label(test_batch[0], 2)

    test_dict = {
        ph['single_index']: test_batch[1],
        ph['numerical_index']: test_batch[2],
        ph['numerical_value']: test_batch[3],
        ph['value']: test_batch[-1],
        ph['label']: test_label,
        train_phase: False