mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-06 06:05:50 +07:00
GitOrigin-RevId: 5682350bfd95a6abfc325b511c55d6e27b41476a
12 lines
359 B
Python
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> |