---
title: "softShrink(a:)"
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/softshrink(a:)"
---

# softShrink(a:)

Creates an instance of a soft shrink activation layer using the lambda value you specify for the soft shrink formation.

## Declaration

```swift
class func softShrink(a: Float) -> Self
```

## Parameters

- `a`: The lambda value for the soft shrink formation.

## Return Value

Return Value A new MLCActivationLayer instance.

## Discussion

Discussion The softShrink(a:) factory type method creates an activation descriptor using init(type:a:), where type = MLCActivationType.softShrink and a = lambda, 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)
- [linear(scale:bias:)](mlcompute/mlcactivationlayer/linear(scale:bias:).md)
- [relun(a:b:)](mlcompute/mlcactivationlayer/relun(a:b:).md)
- [softPlus(beta:)](mlcompute/mlcactivationlayer/softplus(beta:).md)
- [threshold(_:replacement:)](mlcompute/mlcactivationlayer/threshold(_:replacement:).md)
