-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtest.py
More file actions
28 lines (22 loc) · 758 Bytes
/
Copy pathtest.py
File metadata and controls
28 lines (22 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import pandas as pd
import random as rd
import tensorflow as tf
import model as mlr
import sys
NUM_FEATURES = 2
NUM_SEPARATIONS = 2
BATCH_SIZE = 10
LEARNING_RATE = 0.001
STEPS =100000
data = pd.read_csv('data_test.csv', sep=' ', header=None)
input_tensor = tf.placeholder(tf.float32, shape=(1, NUM_FEATURES))
output_tensor = mlr.model(input_tensor, NUM_FEATURES, NUM_SEPARATIONS)
saver = tf.train.Saver()
with tf.Session() as sess:
initializer = tf.global_variables_initializer()
sess.run(initializer)
saver.restore(sess, sys.argv[1])
for i in range(data.shape[0]):
ot = sess.run([output_tensor], feed_dict={input_tensor: data.values[i:i+1,0:NUM_FEATURES]})
print ot[0][0][0]
saver.save(sess, "./saved/model.ckpt")