Commit 99fe19fc authored by Benedetti Paola's avatar Benedetti Paola
Browse files

last

parent dc3aa2fd
No related merge requests found
Showing with 22 additions and 6 deletions
+22 -6
......@@ -93,6 +93,7 @@ ftest_fscore = open(net_path+"test_fscore.txt","a")
ftest_precisions = open(net_path+"test_prec_classes.txt","a")
ftest_recall = open(net_path+"test_rec_classes.txt","a")
ftest_scores = open(net_path+"test_fscore_classes.txt","a")
graph_var = open(net_path+"graph_var.txt","a")
tf.reset_default_graph()
......@@ -107,16 +108,30 @@ with tf.Session() as sess:
writer.close()
graph = tf.get_default_graph()
#for n in tf.global_variables():
# print n
#for op in graph.get_operations():
# print op.values()
# graph_var.write(str(op.values())+"\n")
#graph_var.close()
#exit()
x = graph.get_tensor_by_name("x_rnn:0")
y = graph.get_tensor_by_name("y:0")
#in densenet
'''
if 'AttentionII' in choice:
p = graph.get_tensor_by_name("dense_37/BiasAdd:0")
print "ATTENTION II"
else:
p = graph.get_tensor_by_name("dense_3/BiasAdd:0")
print "ATTENTION I"
'''
p = graph.get_tensor_by_name("prediction:0")
learning_rate = tf.placeholder(tf.float32, shape=[], name="learning_rate")
is_training_ph = tf.placeholder(tf.bool, shape=(), name="is_training")
dropout = tf.placeholder(tf.float32, shape=(), name="drop_rate")
learning_rate = graph.get_tensor_by_name("learning_rate:0")
is_training_ph = graph.get_tensor_by_name("is_training:0")
dropout = graph.get_tensor_by_name("drop_rate:0")
#load ds
test_x = np.load(path_in_val+'test_x%d_%d.npy'%(itr,p_split))
......@@ -143,9 +158,10 @@ with tf.Session() as sess:
for i_batch in range( iter_test ):
batch_x, batch_y = getBatch( test_x, cl, i_batch, batchsz )
pred_temp = sess.run( p , feed_dict = { x:batch_x,
pred_temp = sess.run( p , feed_dict={ x:batch_x,
is_training_ph:False,
learning_rate:0.0002 } )
dropout:1.0,
learning_rate:0.0002} )
for el in pred_temp:
pred_test.append( np.argmax(el) )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment