def binary_accuracy(y_true, y_pred, mask=1): round_y_pred = tf.round(y_pred) right_cnt = tf.cast(tf.equal(y_true, round_y_pred), tf.float32) return compute_weighted_loss(right_cnt, mask)