Python metrics.char_accuracy() Examples
The following are 9
code examples of metrics.char_accuracy().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
metrics
, or try the search function
.
Example #1
Source File: metrics_test.py From DOTA_models with Apache License 2.0 | 5 votes |
def test_char_accuracy_one_char_difference_with_padding(self): ground_truth_np = self._fake_labels() ground_truth_tf = tf.convert_to_tensor(ground_truth_np) prediction_tf = tf.convert_to_tensor( self._incorrect_copy(ground_truth_np, bad_indexes=((0, 0)))) accuracy_tf = metrics.char_accuracy(prediction_tf, ground_truth_tf, self.rej_char) with self.initialized_session() as sess: accuracy_np = sess.run(accuracy_tf) chars_count = self.seq_length * self.batch_size self.assertAlmostEqual(accuracy_np, 1.0 - 1.0 / chars_count)
Example #2
Source File: metrics_test.py From yolo_v2 with Apache License 2.0 | 5 votes |
def test_char_accuracy_one_char_difference_with_padding(self): ground_truth_np = self._fake_labels() ground_truth_tf = tf.convert_to_tensor(ground_truth_np) prediction_tf = tf.convert_to_tensor( self._incorrect_copy(ground_truth_np, bad_indexes=((0, 0)))) accuracy_tf = metrics.char_accuracy(prediction_tf, ground_truth_tf, self.rej_char) with self.initialized_session() as sess: accuracy_np = sess.run(accuracy_tf) chars_count = self.seq_length * self.batch_size self.assertAlmostEqual(accuracy_np, 1.0 - 1.0 / chars_count)
Example #3
Source File: metrics_test.py From Gun-Detector with Apache License 2.0 | 5 votes |
def test_char_accuracy_one_char_difference_with_padding(self): ground_truth_np = self._fake_labels() ground_truth_tf = tf.convert_to_tensor(ground_truth_np) prediction_tf = tf.convert_to_tensor( self._incorrect_copy(ground_truth_np, bad_indexes=((0, 0)))) accuracy_tf = metrics.char_accuracy(prediction_tf, ground_truth_tf, self.rej_char) with self.initialized_session() as sess: accuracy_np = sess.run(accuracy_tf) chars_count = self.seq_length * self.batch_size self.assertAlmostEqual(accuracy_np, 1.0 - 1.0 / chars_count)
Example #4
Source File: metrics_test.py From hands-detection with MIT License | 5 votes |
def test_char_accuracy_one_char_difference_with_padding(self): ground_truth_np = self._fake_labels() ground_truth_tf = tf.convert_to_tensor(ground_truth_np) prediction_tf = tf.convert_to_tensor( self._incorrect_copy(ground_truth_np, bad_indexes=((0, 0)))) accuracy_tf = metrics.char_accuracy(prediction_tf, ground_truth_tf, self.rej_char) with self.initialized_session() as sess: accuracy_np = sess.run(accuracy_tf) chars_count = self.seq_length * self.batch_size self.assertAlmostEqual(accuracy_np, 1.0 - 1.0 / chars_count)
Example #5
Source File: metrics_test.py From object_detection_kitti with Apache License 2.0 | 5 votes |
def test_char_accuracy_one_char_difference_with_padding(self): ground_truth_np = self._fake_labels() ground_truth_tf = tf.convert_to_tensor(ground_truth_np) prediction_tf = tf.convert_to_tensor( self._incorrect_copy(ground_truth_np, bad_indexes=((0, 0)))) accuracy_tf = metrics.char_accuracy(prediction_tf, ground_truth_tf, self.rej_char) with self.initialized_session() as sess: accuracy_np = sess.run(accuracy_tf) chars_count = self.seq_length * self.batch_size self.assertAlmostEqual(accuracy_np, 1.0 - 1.0 / chars_count)
Example #6
Source File: metrics_test.py From object_detection_with_tensorflow with MIT License | 5 votes |
def test_char_accuracy_one_char_difference_with_padding(self): ground_truth_np = self._fake_labels() ground_truth_tf = tf.convert_to_tensor(ground_truth_np) prediction_tf = tf.convert_to_tensor( self._incorrect_copy(ground_truth_np, bad_indexes=((0, 0)))) accuracy_tf = metrics.char_accuracy(prediction_tf, ground_truth_tf, self.rej_char) with self.initialized_session() as sess: accuracy_np = sess.run(accuracy_tf) chars_count = self.seq_length * self.batch_size self.assertAlmostEqual(accuracy_np, 1.0 - 1.0 / chars_count)
Example #7
Source File: metrics_test.py From g-tensorflow-models with Apache License 2.0 | 5 votes |
def test_char_accuracy_one_char_difference_with_padding(self): ground_truth_np = self._fake_labels() ground_truth_tf = tf.convert_to_tensor(ground_truth_np) prediction_tf = tf.convert_to_tensor( self._incorrect_copy(ground_truth_np, bad_indexes=((0, 0)))) accuracy_tf = metrics.char_accuracy(prediction_tf, ground_truth_tf, self.rej_char) with self.initialized_session() as sess: accuracy_np = sess.run(accuracy_tf) chars_count = self.seq_length * self.batch_size self.assertAlmostEqual(accuracy_np, 1.0 - 1.0 / chars_count)
Example #8
Source File: metrics_test.py From models with Apache License 2.0 | 5 votes |
def test_char_accuracy_one_char_difference_with_padding(self): ground_truth_np = self._fake_labels() ground_truth_tf = tf.convert_to_tensor(ground_truth_np) prediction_tf = tf.convert_to_tensor( self._incorrect_copy(ground_truth_np, bad_indexes=((0, 0)))) accuracy_tf = metrics.char_accuracy(prediction_tf, ground_truth_tf, self.rej_char) with self.initialized_session() as sess: accuracy_np = sess.run(accuracy_tf) chars_count = self.seq_length * self.batch_size self.assertAlmostEqual(accuracy_np, 1.0 - 1.0 / chars_count)
Example #9
Source File: metrics_test.py From multilabel-image-classification-tensorflow with MIT License | 5 votes |
def test_char_accuracy_one_char_difference_with_padding(self): ground_truth_np = self._fake_labels() ground_truth_tf = tf.convert_to_tensor(ground_truth_np) prediction_tf = tf.convert_to_tensor( self._incorrect_copy(ground_truth_np, bad_indexes=((0, 0)))) accuracy_tf = metrics.char_accuracy(prediction_tf, ground_truth_tf, self.rej_char) with self.initialized_session() as sess: accuracy_np = sess.run(accuracy_tf) chars_count = self.seq_length * self.batch_size self.assertAlmostEqual(accuracy_np, 1.0 - 1.0 / chars_count)