Files
andrey.matveevandintellij-monorepo-bot 073af04a6a PY-38581 Implement previous calls feature
GitOrigin-RevId: 5682350bfd95a6abfc325b511c55d6e27b41476a
2020-02-25 05:37:15 +00:00

12 lines
359 B
Python

import tensorflow as tf
import numpy as np
labels_map = [np.argmax(c) for c in counts]
labels_map = tf.convert_to_tensor(labels_map)
cluster_label = tf.nn.embedding_lookup(labels_map, cluster_idx)
correct_prediction = tf.equal(cluster_label, tf.cast(tf.argmax(Y, 1), tf.int32))
accuracy_op = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
<caret>