Note: The logistic activation function already exists in tf.nn.logistic. However, I am trying to develop a custom activation which is on similar lines. Please refer to the code snippet below.
def custom_logistic(x):
value= tf.to_float(tf.math.exp(-x))
Activate_input = 1/(1+value)
return Activate_input
Now, when I am calling the above function at the input layer of the code:
model.add(Dense(10, input_dim=3, activation=custom_logistic))
Note: Here, the model is a sequential model.
I get an accuracy that is lesser than what I get when I use activation = tf.nn.sigmoid
Is there anything else I need to define?. Please let me know.