I'm having trouble with accuracy evaluation at the end of Session.
Training process looks like this:
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
epochs = 10
batch_size = 128
for e in range(epochs):
shuffle_indices = np.random.permutation(np.arange(len(inputx)))
X_train = inputx[shuffle_indices]
y_train = inputy[shuffle_indices]
epoch_loss = 0
for i in range(int(len(inputx) // batch_size)):
start = i * batch_size
batch_x = X_train[start:start + batch_size]
batch_y = y_train[start:start + batch_size]
_, c = sess.run([optimizer, cost], feed_dict={x: batch_x, y: batch_y})
epoch_loss += c
print(e + 1, '/', epochs, 'loss:', epoch_loss)
At the end of this session I want to evaluate reached accuracy by calculating mean value of percentual differences between prediction
and testy
for each of 3 output layer neurons.
percentual_differences_for_neuron1 = # insert your advice here
accuracy_for_neuron1 = tf.reduce_mean(percentual_differences_for_neuron1)
print('Accuracy of neuron 1 is', '''another advice''')
What's the best way of doing this in TensorFlow?