Skip to content

Instantly share code, notes, and snippets.

@mrubash1
Created March 22, 2017 22:57
Show Gist options
  • Save mrubash1/97c33a71574e787b836b9e4e08fd074e to your computer and use it in GitHub Desktop.
Save mrubash1/97c33a71574e787b836b9e4e08fd074e to your computer and use it in GitHub Desktop.
def setup_summary_statistics(self):
# Create a placeholder for the summary statistics
with tf.name_scope("accuracy"):
# Compute the edit (Levenshtein) distance of the top path
distance = tf.edit_distance(tf.cast(self.decoded[0], tf.int32), self.targets)
# Compute the label error rate (accuracy)
self.ler = tf.reduce_mean(distance, name='label_error_rate')
self.ler_placeholder = tf.placeholder(dtype=tf.float32, shape=[])
self.train_ler_op = tf.summary.scalar("train_label_error_rate", self.ler_placeholder)
self.dev_ler_op = tf.summary.scalar("validation_label_error_rate", self.ler_placeholder)
self.test_ler_op = tf.summary.scalar("test_label_error_rate", self.ler_placeholder)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment