<!--
{
  "availability" : [
    "*: -",
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/BNNS/ActivationFunction/elu(alpha:)",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate4BNNSO18ActivationFunctionO3eluyAESf_tcAEmF"
  },
  "title" : "BNNS.ActivationFunction.elu(alpha:)"
}
-->

# BNNS.ActivationFunction.elu(alpha:)

An activation function that evaluates the exponential linear units (ELU) on its input.

```
case elu(alpha: Float)
```

## Discussion

This constant defines an activation function that returns values using the following operation:

```c
if x < 0
    alpha*(exp(x) - 1)
else
    x
```

The following illustrates the output that the activation function generates from inputs in the range `-10...10` and an `alpha` of `1`:

![Graph that shows input values for the activation function on horizontal axis and its output values on vertical axis.](images/com.apple.accelerate/media-3654638@2x.png)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)