---
title: "init(type:a:)"
framework: ML Compute
role: symbol
role_heading: Initializer
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: "mlcompute/mlcactivationdescriptor/init(type:a:)"
---

# init(type:a:)

Creates an activation descriptor with the activation type and parameter a that you specify.

## Declaration

```swift
convenience init?(type activationType: MLCActivationType, a: Float)
```

## Parameters

- `activationType`: A type of activation function.
- `a`: Parameter a.

## Discussion

Discussion Use this initializer to create one of the following activation descriptors: Activation type: MLCActivationType.celu For common behavior, set a to 1.0. Activation type: MLCActivationType.hardShrink For common behavior, set a to 0.5. Activation type: MLCActivationType.elu For common behavior, set a to 1.0. Activation type: MLCActivationType.relu This is also referred to as Leaky ReLU. Some literature defines classical ReLU as max(0, x). If you want this common behavior, set a to 0.0. Activation type: MLCActivationType.softShrink For common behavior, set a to 0.5.

## See Also

### Creating Activation Descriptors

- [init(type:)](mlcompute/mlcactivationdescriptor/init(type:).md)
- [init(type:a:b:)](mlcompute/mlcactivationdescriptor/init(type:a:b:).md)
- [init(type:a:b:c:)](mlcompute/mlcactivationdescriptor/init(type:a:b:c:).md)
- [MLCActivationType](mlcompute/mlcactivationtype.md)
