Fix bug where the test accuracy shown during test computation is computed wrongly. The final test accuracy report is correct however so logged results should be correct.

This commit is contained in:
AntreasAntoniou 2018-02-11 20:49:40 +00:00
parent 81fb17f06a
commit f707b10ef0
5 changed files with 5 additions and 5 deletions

View File

@ -160,7 +160,7 @@ with tf.Session() as sess:
total_test_accuracy = 0. total_test_accuracy = 0.
# computer test loss and accuracy and save # computer test loss and accuracy and save
with tqdm.tqdm(total=total_test_batches) as pbar_test: with tqdm.tqdm(total=total_test_batches) as pbar_test:
for batch_id, (x_batch, y_batch) in enumerate(test_data): for batch_idx, (x_batch, y_batch) in enumerate(test_data):
c_loss_value, acc = sess.run( c_loss_value, acc = sess.run(
[losses_ops["crossentropy_losses"], losses_ops["accuracy"]], [losses_ops["crossentropy_losses"], losses_ops["accuracy"]],
feed_dict={dropout_rate: dropout_rate_value, data_inputs: x_batch, feed_dict={dropout_rate: dropout_rate_value, data_inputs: x_batch,

View File

@ -160,7 +160,7 @@ with tf.Session() as sess:
total_test_accuracy = 0. total_test_accuracy = 0.
# computer test loss and accuracy and save # computer test loss and accuracy and save
with tqdm.tqdm(total=total_test_batches) as pbar_test: with tqdm.tqdm(total=total_test_batches) as pbar_test:
for batch_id, (x_batch, y_batch) in enumerate(test_data): for batch_idx, (x_batch, y_batch) in enumerate(test_data):
c_loss_value, acc = sess.run( c_loss_value, acc = sess.run(
[losses_ops["crossentropy_losses"], losses_ops["accuracy"]], [losses_ops["crossentropy_losses"], losses_ops["accuracy"]],
feed_dict={dropout_rate: dropout_rate_value, data_inputs: x_batch, feed_dict={dropout_rate: dropout_rate_value, data_inputs: x_batch,

View File

@ -160,7 +160,7 @@ with tf.Session() as sess:
total_test_accuracy = 0. total_test_accuracy = 0.
# computer test loss and accuracy and save # computer test loss and accuracy and save
with tqdm.tqdm(total=total_test_batches) as pbar_test: with tqdm.tqdm(total=total_test_batches) as pbar_test:
for batch_id, (x_batch, y_batch) in enumerate(test_data): for batch_idx, (x_batch, y_batch) in enumerate(test_data):
c_loss_value, acc = sess.run( c_loss_value, acc = sess.run(
[losses_ops["crossentropy_losses"], losses_ops["accuracy"]], [losses_ops["crossentropy_losses"], losses_ops["accuracy"]],
feed_dict={dropout_rate: dropout_rate_value, data_inputs: x_batch, feed_dict={dropout_rate: dropout_rate_value, data_inputs: x_batch,

View File

@ -161,7 +161,7 @@ with tf.Session() as sess:
total_test_accuracy = 0. total_test_accuracy = 0.
# computer test loss and accuracy and save # computer test loss and accuracy and save
with tqdm.tqdm(total=total_test_batches) as pbar_test: with tqdm.tqdm(total=total_test_batches) as pbar_test:
for batch_id, (x_batch, y_batch) in enumerate(test_data): for batch_idx, (x_batch, y_batch) in enumerate(test_data):
c_loss_value, acc = sess.run( c_loss_value, acc = sess.run(
[losses_ops["crossentropy_losses"], losses_ops["accuracy"]], [losses_ops["crossentropy_losses"], losses_ops["accuracy"]],
feed_dict={dropout_rate: dropout_rate_value, data_inputs: x_batch, feed_dict={dropout_rate: dropout_rate_value, data_inputs: x_batch,

View File

@ -160,7 +160,7 @@ with tf.Session() as sess:
total_test_accuracy = 0. total_test_accuracy = 0.
# computer test loss and accuracy and save # computer test loss and accuracy and save
with tqdm.tqdm(total=total_test_batches) as pbar_test: with tqdm.tqdm(total=total_test_batches) as pbar_test:
for batch_id, (x_batch, y_batch) in enumerate(test_data): for batch_idx, (x_batch, y_batch) in enumerate(test_data):
c_loss_value, acc = sess.run( c_loss_value, acc = sess.run(
[losses_ops["crossentropy_losses"], losses_ops["accuracy"]], [losses_ops["crossentropy_losses"], losses_ops["accuracy"]],
feed_dict={dropout_rate: dropout_rate_value, data_inputs: x_batch, feed_dict={dropout_rate: dropout_rate_value, data_inputs: x_batch,