A ReLU (Rectified Linear Unit) neuron filter.
SDKs
- iOS 10.0+
- macOS 10.13+
- Mac Catalyst 13.0+
- tvOS 10.0+
Framework
- Metal Performance Shaders
Declaration
class MPSCNNNeuronReLU : MPSCNNNeuron
Overview
For each pixel in an image, the filter applies the following function:

This filter is called leaky 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
.