code: def hard_sigmoid(x):
      """Hard sigmoid activation function.
  
      The hard sigmoid activation is defined as:
  
      - `0` if `if x < -2.5`
      - `1` if `x > 2.5`
      - `0.2 * x + 0.5` if `-2.5 <= x <= 2.5`
  
      It's a faster, piecewise linear approximation
      of the sigmoid activation.
  
      Args:
          x: Input tensor.
  
      Reference:
  
      - [Wikipedia "Hard sigmoid"](https://en.wikipedia.org/wiki/Hard_sigmoid)
      """
      return ops.hard_sigmoid(x)
  
imports: from keras import backend
  from keras import ops
  from keras.api_export import keras_export
label_desc: Use image node_id 14 for calling a global function with example usage: hard_sigmoid(x) and returns: ops