Swim: A General-Purpose, High-Performing, and Efficient Activation Function for Locomotion Control Tasks

Maryam Abdool,Tony Dear
2023-03-05
Abstract:Activation functions play a significant role in the performance of deep learning algorithms. In particular, the Swish activation function tends to outperform ReLU on deeper models, including deep reinforcement learning models, across challenging tasks. Despite this progress, ReLU is the preferred function partly because it is more efficient than Swish. Furthermore, in contrast to the fields of computer vision and natural language processing, the deep reinforcement learning and robotics domains have seen less inclination to adopt new activation functions, such as Swish, and instead continue to use more traditional functions, like ReLU. To tackle those issues, we propose Swim, a general-purpose, efficient, and high-performing alternative to Swish, and then provide an analysis of its properties as well as an explanation for its high-performance relative to Swish, in terms of both reward-achievement and efficiency. We focus on testing Swim on MuJoCo's locomotion continuous control tasks since they exhibit more complex dynamics and would therefore benefit most from a high-performing and efficient activation function. We also use the TD3 algorithm in conjunction with Swim and explain this choice in the context of the robot locomotion domain. We then conclude that Swim is a state-of-the-art activation function for continuous control locomotion tasks and recommend using it with TD3 as a working framework.
Machine Learning,Neural and Evolutionary Computing,Robotics
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: in the fields of deep reinforcement learning and robotics, traditional activation functions (such as ReLU) are efficient but have limited performance, while newer activation functions (such as Swish) have better performance but higher computational costs. Therefore, the author proposes a new activation function, Swim, which aims to combine the advantages of high efficiency and high performance and is especially suitable for motion - control tasks. Specifically, the paper focuses on: 1. **Improving performance**: New activation functions such as Swish perform well in deep models, but are not as efficient as ReLU. The paper proposes Swim in the hope of outperforming Swish in performance and maintaining or improving efficiency. 2. **Improving efficiency**: Although Swish outperforms ReLU in performance, it has a high computational cost because it involves exponential operations. Swim reduces the computational complexity and thus improves efficiency by using square roots and quadratic terms instead of exponential operations. 3. **Adapting to specific fields**: Compared with the fields of computer vision and natural language processing, the fields of deep reinforcement learning and robotics less often adopt new activation functions. The paper proves the advantages of Swim in these tasks by testing it on MuJoCo's continuous motion - control tasks. ### Formula representation The mathematical definition of Swim is as follows: \[ f(x)=\frac{x}{2}(kx\sqrt{1 + k^{2}x^{2}}+ 1)\] Its first - order derivative is: \[ f^{\prime}(x)=\frac{1}{2}(\frac{kx(k^{2}x^{2}+2)}{(1 + k^{2}x^{2})^{3/2}}+1)\] where \(k\) is an adjustable constant, which is set to 0.5 in the experiment to approximate the performance of the Swish function when \(\beta = 1\). ### Conclusion The paper proves through experiments that Swim not only outperforms Swish in performance in multiple motion - control tasks, but also has a significant improvement in computational efficiency. This makes Swim an efficient and high - performance activation function suitable for the fields of deep reinforcement learning and robotics.