Reputation: 3616
I have a tensor X
. If I just want to keep all values larger than zero I can use
X = tf.nn.relu(X)
But what do I do in the opposite case? I only can think of this solution:
X = tf.multiply(-1.0, tf.nn.relu(tf.multiply(-1.0, X)))
I wondered if there is a more sophisticated way to do that.
Any suggestions?
Upvotes: 1
Views: 1593