<!--
{
  "availability" : [
    "iOS: 14.0.0 - 17.4.0",
    "iPadOS: 14.0.0 - 17.4.0",
    "macCatalyst: 14.0.0 - 17.4.0",
    "macOS: 11.0.0 - 14.3.0",
    "tvOS: 14.0.0 - 17.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "MLCompute",
  "identifier" : "/documentation/MLCompute/MLCActivationLayer/leakyReLU(negativeSlope:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:objc(cs)MLCActivationLayer(cm)leakyReLULayerWithNegativeSlope:"
  },
  "title" : "leakyReLU(negativeSlope:)"
}
-->

# leakyReLU(negativeSlope:)

Creates an instance of a leaky ReLU activation layer using the angle of the negative slope you specify.

```
class func leakyReLU(negativeSlope: Float) -> Self
```

## Parameters

`negativeSlope`

The angle of the negative slope.

## Return Value

A new `MLCActivationLayer` instance.

## Discussion

The [`leakyReLU(negativeSlope:)`](/documentation/MLCompute/MLCActivationLayer/leakyReLU(negativeSlope:)) factory type method creates an activation descriptor using [`init(type:a:)`](/documentation/MLCompute/MLCActivationDescriptor/init(type:a:)), where `type =` [`MLCActivationType.relu`](/documentation/MLCompute/MLCActivationType/relu) and `a = negativeSlope`, and passes that descriptor to [`init(descriptor:)`](/documentation/MLCompute/MLCActivationLayer/init(descriptor:)).

---

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)