def newactivation(x):
if x>0:
return K.relu(x, alpha=0, max_value=None)
else :
return x * K.sigmoid(0.7* x)
get_custom_objects().update({'newactivation': Activation(newactivation)})
I am trying to use this activation function for my model in keras, but I am having hard time by finding what to replace
if x>0:
ERROR i got:
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py", line 614, in bool raise TypeError("Using a
tf.Tensor
as a Pythonbool
is not allowed. "TypeError: Using a
tf.Tensor
as a Pythonbool
is not allowed. Useif >t is not None:
instead ofif t:
to test if a tensor is defined, and >use TensorFlow ops such as tf.cond to execute subgraphs conditioned on >the value of a tensor.
Can someone make it clear for me?