Abstract
Activation functions (AFs) are crucial components in neural networks for deep learning. Piecewise linear functions (PLFs) have been widely employed to act as AFs, thanks to their computational efficiencies and simplicities. However, PLFs are not completely differentiable, leading to potential training problems. The analytical expressions of AFs based on pure PLFs can be smoothed via the mollified square root function (MSRF) method, inspired by the SquarePlus method of ReLU approximation. In this paper, we propose a proposition defining AFs as the maximum or minimum of two PLFs and transform the results into a smoothed function via the MSRF method. Based on MSRF, we modify well-known AFs composed of two, three, or four PLFs into regularized versions systematically. The derivatives of these mollified versions demonstrate their smoothness properties. The proposed method can be extended to AFs composed of multiple PLFs easily.
Introduction
Activation functions are the fundamental non-linear units in neural networks. While piecewise linear functions (PLFs) like the Rectified Linear Unit (ReLU) are computationally efficient, their non-differentiability at "hinge" points can impede optimization during backpropagation. Traditional smooth alternatives, such as SoftPlus, rely on transcendental functions (exponential and logarithmic) which are computationally expensive. This paper introduces the Mollified Square Root Function (MSRF) method as a bridge, providing a framework to smooth any PLF using simple algebraic operations.
Methodology
The core of the MSRF method lies in replacing the non-smooth absolute value term found in many PLF definitions with an algebraic square-root approximation. The authors utilize the mathematical identity: $$\max(f_1, f_2) = \frac{1}{2}(f_1 + f_2 + |f_1 - f_2|)$$ By substituting the absolute value $|x|$ with its mollified version $|x|_\epsilon = \sqrt{x^2 + \epsilon}$, where $\epsilon$ is a small positive parameter, any function defined by the maximum or minimum of linear segments can be transformed into a $C^\infty$ smooth function.
As shown in Figure 1, this approach creates a systematic mapping between standard functions (ReLU, Step) and their regularized counterparts (SquarePlus, StepPlus), maintaining functional equivalence to transcendental versions like SoftPlus and Sigmoid without the associated computational overhead.
Key Insights and Theoretical Framework
The paper's primary contribution is the MaxPlus/MinPlus Proposition, which generalizes the smoothing process for any AF composed of linear segments. This allows for the creation of a library of "Plus" functions, including LReLUPlus, vReLUPlus, and HtanhPlus.
A significant advantage of the MSRF method is computational efficiency. Square root operations are typically much faster to compute than the exponential and logarithmic functions required for SoftPlus or Swish. Furthermore, by smoothing the sharp corners of PLFs, the MSRF versions ensure that gradients are defined everywhere, potentially mitigating issues like the "dying ReLU" problem.
Results and Discussion
The analytical derivatives derived for each proposed function confirm their smoothness. Visual analysis demonstrates that the mollified versions track the original piecewise functions closely while providing a continuous transition at the former points of non-differentiability.
As illustrated in Figure 2, the derivatives of the "Plus" versions are continuous and well-behaved, unlike the discontinuous derivatives of the original Step or ReLU functions. This property is essential for stable gradient-based optimization in deep learning architectures.
Conclusion
The MSRF method provides a robust and computationally efficient framework for regularizing piecewise linear activation functions. By transforming non-differentiable hinges into smooth curves, these functions offer the benefits of PLFs—simplicity and speed—while ensuring the differentiability required for modern training algorithms. Future work will explore the empirical performance of these functions in large-scale deep learning models and the potential for learning the smoothing parameter $\epsilon$ dynamically.
Summary updated