<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/BNNSActivationFunctionClampedLeakyRectifiedLinear",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@EA@BNNSActivationFunction@BNNSActivationFunctionClampedLeakyRectifiedLinear"
  },
  "title" : "BNNSActivationFunctionClampedLeakyRectifiedLinear"
}
-->

# BNNSActivationFunctionClampedLeakyRectifiedLinear

An activation function that returns its input clamped to beta when that is greater than or equal to zero, otherwise it returns its input multiplied by alpha clamped to beta.

```
var BNNSActivationFunctionClampedLeakyRectifiedLinear: BNNSActivationFunction { get }
```

## Discussion

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

```
if x < 0
    min(alpha*x, beta)
else
    min(x, beta) 
```

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

![Graph that shows input values for the activation function on horizontal axis and its output values on vertical axis. ](images/com.apple.accelerate/media-3560471@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)