Dual ReLU is a two-dimensional activation function proposed as a replacement for tanh in quasi-recurrent neural networks (QRNNs).

The function is not smooth; it is monotonically increasing in a and monotonically decreasing in b.

Dual ReLU is designed as an activation function for recurrent neural networks and applies a nonlinear activation based on two different input dimensions.

Its output range covers all real numbers. It aims to provide nonlinearity similar to ReLU while processing inputs in a way suited to the characteristics of RNNs.

DualReLU(a,b)=max⁡(0,a)−max⁡(0,b)\text{DualReLU}(a, b) = \max(0, a) - \max(0, b)

The output range is

−∞<DualReLU(a,b)<∞-∞ < \text{DualReLU}(a, b) < ∞