<!--
{
  "availability" : [
    "*: -",
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/BNNSActivationFunction/linear",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:So22BNNSActivationFunctiona10AccelerateE6linearABvpZ"
  },
  "title" : "linear"
}
-->

# linear

An activation function that returns its input multiplied by a specified value.

```
static var linear: BNNSActivationFunction { get }
```

## Discussion

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

```c
alpha*x
```

Use `alpha` to specify the multiplier:

```swift
var activation = BNNSActivation(function: .linear,
                                alpha: 0.2)
```

The following illustrates the output that the activation function generates from inputs in the range `-10...10`:

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