<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/activations/activations.py#L381-L399) |

Gated Linear Unit (GLU) activation function.

    tf.keras.activations.glu(
        x, axis=-1
    )

The GLU activation function is defined as:

`glu(x) = a * sigmoid(b)`,

where `x` is split into two equal parts `a` and `b` along the given axis.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. |
| `axis` | The axis along which to split the input tensor. Defaults to `-1`. |

<br />

#### Reference:

- [Dauphin et al., 2017](https://arxiv.org/abs/1612.08083)