<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#L197-L234) |

Scaled Exponential Linear Unit (SELU).

    tf.keras.activations.selu(
        x
    )

The Scaled Exponential Linear Unit (SELU) activation function is defined as:

- `scale * x` if `x > 0`
- `scale * alpha * (exp(x) - 1)` if `x < 0`

where `alpha` and `scale` are pre-defined constants
(`alpha=1.67326324` and `scale=1.05070098`).

Basically, the SELU activation function multiplies `scale` (\> 1) with the
output of the [`keras.activations.elu`](https://www.tensorflow.org/api_docs/python/tf/keras/activations/elu) function to ensure a slope larger
than one for positive inputs.

The values of `alpha` and `scale` are
chosen so that the mean and variance of the inputs are preserved
between two consecutive layers as long as the weights are initialized
correctly (see [`keras.initializers.LecunNormal`](https://www.tensorflow.org/api_docs/python/tf/keras/initializers/LecunNormal) initializer)
and the number of input units is "large enough"
(see reference paper for more information).

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. |

<br />

#### Notes:

- To be used together with the [`keras.initializers.LecunNormal`](https://www.tensorflow.org/api_docs/python/tf/keras/initializers/LecunNormal) initializer.
- To be used together with the dropout variant [`keras.layers.AlphaDropout`](https://www.tensorflow.org/api_docs/python/tf/keras/layers/AlphaDropout) (rather than regular dropout).

#### Reference:

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