Q:

prediction in tensor flow for multiple labels

How can I get a prediction vector in the tensorflow graph apart from 
predict = tf.argmax(y) ? (since argmax only works for softmax classifiers)
I have a multilabel classification problem so therefore I need something like:
predictions = [1. if prob > 0.5 else 0. for prob in y]

A:

Hope this helps :
import tensorflow as tf
import numpy as np
sess = tf.InteractiveSession()
prob = tf.constant(np.random.rand(10))
predictions = tf.select(prob > 0.5, tf.ones_like(prob), tf.zeros_like(prob))
print(predictions.eval())

