<!--
{
  "availability" : [
    "iOS: 10.0.0 - 12.0.0",
    "iPadOS: 10.0.0 - 12.0.0",
    "macOS: 10.13.0 - 10.14.0",
    "tvOS: 10.0.0 - 12.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSCNNNeuronLinear/init(device:a:b:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSCNNNeuronLinear(im)initWithDevice:a:b:"
  },
  "title" : "init(device:a:b:)"
}
-->

# init(device:a:b:)

Initializes a linear neuron filter.

```
init(device: any MTLDevice, a: Float, b: Float)
```

## Parameters

`device`

The device the filter will run on.

`a`

The “a” variable of the filter function.

`b`

The “b” variable of the filter function.

## Return Value

A valid [`MPSCNNNeuronLinear`](/documentation/MetalPerformanceShaders/MPSCNNNeuronLinear) object or `nil`, if failure.

---

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)