---
title: MPSCNNNeuronReLU
framework: metalperformanceshaders
role: symbol
role_heading: Class
path: metalperformanceshaders/mpscnnneuronrelu
---

# MPSCNNNeuronReLU

A ReLU (Rectified Linear Unit) neuron filter.

## Declaration

```swift
class MPSCNNNeuronReLU
```

## Overview

Overview For each pixel in an image, the filter applies the following function:

This filter is called l__eaky ReLU in CNN literature. Some CNN literature defines classical ReLU as max(0, x). If you want this behavior, simply set the a property to 0.

## Topics

### Initializers

- [init(device:a:)](metalperformanceshaders/mpscnnneuronrelu/init(device:a:).md)

## Relationships

### Inherits From

- [MPSCNNNeuron](metalperformanceshaders/mpscnnneuron.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Neuron Layers

- [MPSCNNNeuronAbsolute](metalperformanceshaders/mpscnnneuronabsolute.md)
- [MPSCNNNeuronELU](metalperformanceshaders/mpscnnneuronelu.md)
- [MPSCNNNeuronHardSigmoid](metalperformanceshaders/mpscnnneuronhardsigmoid.md)
- [MPSCNNNeuronLinear](metalperformanceshaders/mpscnnneuronlinear.md)
- [MPSCNNNeuronPReLU](metalperformanceshaders/mpscnnneuronprelu.md)
- [MPSCNNNeuronReLUN](metalperformanceshaders/mpscnnneuronrelun.md)
- [MPSCNNNeuronSigmoid](metalperformanceshaders/mpscnnneuronsigmoid.md)
- [MPSCNNNeuronSoftPlus](metalperformanceshaders/mpscnnneuronsoftplus.md)
- [MPSCNNNeuronSoftSign](metalperformanceshaders/mpscnnneuronsoftsign.md)
- [MPSCNNNeuronTanH](metalperformanceshaders/mpscnnneurontanh.md)
- [MPSCNNNeuron](metalperformanceshaders/mpscnnneuron.md)
- [MPSCNNNeuronExponential](metalperformanceshaders/mpscnnneuronexponential.md)
- [MPSCNNNeuronGradient](metalperformanceshaders/mpscnnneurongradient.md)
- [MPSCNNNeuronLogarithm](metalperformanceshaders/mpscnnneuronlogarithm.md)
- [MPSCNNNeuronPower](metalperformanceshaders/mpscnnneuronpower.md)
