0
次のコードを使用して、モデルの精度とリコールを評価しました。 Z3及びYの形状の両方は、(1 ,?)tf.metricsを正しく使うには?
predictions = tf.greater(Z3, 0.0)
labels = tf.greater(Y, 0.5)
true_positive = tf.logical_and(predictions, labels)
precision = tf.reduce_sum(tf.cast((true_positive), tf.float32))/tf.reduce_sum(tf.cast((predictions), tf.float32))
recall = tf.reduce_sum(tf.cast((true_positive), tf.float32))/tf.reduce_sum(tf.cast((labels), tf.float32))
作品上記のコードが、私は以下のコードに切り替えたとき、それは動作しません。
labels = tf.greater(Y, 0.5)
predictions = tf.greater(Z3, 0.0)
auc = tf.metrics.auc(labels, predictions)
precisions = tf.metrics.precision(labels, predictions)
recalls = tf.metrics.recall(labels, predictions)
InvalidArgumentError (see above for traceback): tags and values not the same shape: [] != [2] (tag 'recalls')
[[Node: recalls = ScalarSummary[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"](recalls/tags, recalls/values)]]
それは形状が異なっているようですが、私はそれらの両方のショー(1 ,?)印刷するとき。
これらの2つのテンソルの形を見つけたり、実行したり、この問題を修正する方法はありますか?