tf.keras.activations.hard_tanh

HardTanh activation function.

It is defined as:

hard_tanh(x) = -1 for x < -1, hard_tanh(x) = x for -1 <= x <= 1, hard_tanh(x) = 1 for x > 1.

x Input tensor.