---
title: MLCActivationType.tanh
framework: ML Compute
role: symbol
role_heading: Case
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: mlcompute/mlcactivationtype/tanh
---

# MLCActivationType.tanh

An activation type that implements the hyperbolic tangent activation function.

## Declaration

```swift
case tanh
```

## Discussion

Discussion This activation type implements the function: f(x) = a * tanh(b * x)

## See Also

### Enumeration Cases

- [MLCActivationType.absolute](mlcompute/mlcactivationtype/absolute.md)
- [MLCActivationType.celu](mlcompute/mlcactivationtype/celu.md)
- [MLCActivationType.clamp](mlcompute/mlcactivationtype/clamp.md)
- [MLCActivationType.elu](mlcompute/mlcactivationtype/elu.md)
- [MLCActivationType.gelu](mlcompute/mlcactivationtype/gelu.md)
- [MLCActivationType.hardShrink](mlcompute/mlcactivationtype/hardshrink.md)
- [MLCActivationType.hardSigmoid](mlcompute/mlcactivationtype/hardsigmoid.md)
- [MLCActivationType.hardSwish](mlcompute/mlcactivationtype/hardswish.md)
- [MLCActivationType.linear](mlcompute/mlcactivationtype/linear.md)
- [MLCActivationType.logSigmoid](mlcompute/mlcactivationtype/logsigmoid.md)
- [MLCActivationType.none](mlcompute/mlcactivationtype/none.md)
- [MLCActivationType.relu](mlcompute/mlcactivationtype/relu.md)
- [MLCActivationType.relun](mlcompute/mlcactivationtype/relun.md)
- [MLCActivationType.selu](mlcompute/mlcactivationtype/selu.md)
- [MLCActivationType.sigmoid](mlcompute/mlcactivationtype/sigmoid.md)
