gcn/metrics.py
def masked_accuracy_all(preds, labels, mask):
    """compare each prediction with each label"""
    correct_prediction = tf.equal(tf.argmax(preds, 1), tf.argmax(labels, 1))
    accuracy_all = tf.cast(correct_prediction, tf.float32)
    mask = tf.cast(mask, dtype=tf.float32)
    mask /= tf.reduce_mean(mask)
    accuracy_all *= mask
    return accuracy_all
compare each prediction with each label
compare each prediction with each label
compare each prediction with each label
def masked_accuracy_all(preds, labels, mask):
    correct_prediction = tf.equal(tf.argmax(preds, 1), tf.argmax(labels, 1))
    accuracy_all = tf.cast(correct_prediction, tf.float32)
    mask = tf.cast(mask, dtype=tf.float32)
    mask /= tf.reduce_mean(mask)
    accuracy_all *= mask
    return accuracy_all
def masked_accuracy_all ( preds , labels , mask ) : correct_prediction = tf . equal ( tf . argmax ( preds , 1 ) , tf . argmax ( labels , 1 ) ) accuracy_all = tf . cast ( correct_prediction , tf . float32 ) mask = tf . cast ( mask , dtype = tf . float32 ) mask /= tf . reduce_mean ( mask ) accuracy_all *= mask return accuracy_all
compare each prediction with each label
compare each prediction with each label
"""compare each prediction with each label"""
preds
labels
mask