python - using leaky relu in Tensorflow -


how can change g_h1 = tf.nn.relu(tf.matmul(z, g_w1) + g_b1) leaky relu? have tried looping on tensor using max(value, 0,01*value) typeerror: using tf.tensor python bool not allowed.

i tried find source code on relu on tensorflow github can modify leaky relu couldn't find it..

you write 1 based on tf.relu, like:

def lrelu(x, alpha):   return tf.nn.relu(x) - alpha * tf.nn.relu(-x) 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -