---
title: "linear(scale:bias:)"
framework: ML Compute
role: symbol
role_heading: Type Method
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: "mlcompute/mlcactivationlayer/linear(scale:bias:)"
---

# linear(scale:bias:)

Creates an instance of a linear activation layer using the scale factor and bias value you specify.

## Declaration

```swift
class func linear(scale: Float, bias: Float) -> Self
```

## Parameters

- `scale`: The scale factor.
- `bias`: The bias value.

## Return Value

Return Value A new MLCActivationLayer instance.

## Discussion

Discussion The linear(scale:bias:) factory type method creates an activation descriptor using init(type:a:b:), where type = MLCActivationType.linear, a = scale, and b = bias, and passes that descriptor to init(descriptor:).

## See Also

### Factory Methods

- [celu(a:)](mlcompute/mlcactivationlayer/celu(a:).md)
- [clamp(min:max:)](mlcompute/mlcactivationlayer/clamp(min:max:).md)
- [elu(a:)](mlcompute/mlcactivationlayer/elu(a:).md)
- [hardShrink(a:)](mlcompute/mlcactivationlayer/hardshrink(a:).md)
- [leakyReLU(negativeSlope:)](mlcompute/mlcactivationlayer/leakyrelu(negativeslope:).md)
- [relun(a:b:)](mlcompute/mlcactivationlayer/relun(a:b:).md)
- [softPlus(beta:)](mlcompute/mlcactivationlayer/softplus(beta:).md)
- [softShrink(a:)](mlcompute/mlcactivationlayer/softshrink(a:).md)
- [threshold(_:replacement:)](mlcompute/mlcactivationlayer/threshold(_:replacement:).md)
